Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 3 of 3 total |
Using DBISAM as part of a WebService |
Wed, Aug 26 2009 3:27 AM | Permanent Link |
Jonathan Mackey | I have recently migrated our current software from a desktop-based platform to a
WebService. I had a problem a while back connecting to the database, I got around that by using this code: [code] session.PrivateDir := GetCurrentDir + '\DB'; tblSingleApplicant := TDBISAMTable.Create(nil); dsSingleApplicant := TDataSource.Create(nil); qrySingleApplicant := TDBISAMQuery.Create(nil); tblSingleApplicant.DatabaseName := 'DB'; tblSingleApplicant.TableName := 'App.DAT'; dsSingleApplicant.DataSet := tblSingleApplicant; qrySingleApplicant.DataSource := dsSingleApplicant; qrySingleApplicant.DatabaseName := 'DB'; [/code] This works for desktop applications, but when I try to do this running it as a WebService it tells me that it cannot find DB\App.DAT. I'm hoping that someone here can shed some light on what I'm doing wrong! I'm running IIS7 and the DB folder is in the same folder as the dll. Many thanks, Jonathan |
Wed, Aug 26 2009 5:57 AM | Permanent Link |
"Eduardo [HPro]" | Jonathan
If database information share the folder with DLL, then I will not use C/S approach. Instead of I will use something like below: Database := TDBISamDatabase.Create(nil); Database.DatabaseName := 'DB'; Database.Directory := 'c:\mydata'; And the other things stay in the same way. Eduardo |
Wed, Aug 26 2009 11:55 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Jonathan,
<< This works for desktop applications, but when I try to do this running it as a WebService it tells me that it cannot find DB\App.DAT. I'm hoping that someone here can shed some light on what I'm doing wrong! I'm running IIS7 and the DB folder is in the same folder as the dll. >> You're probably going to need to use a full path name, or at least make sure to set the current working directory (SetCurrentDir function in Delphi) at the start of the web service if you want to use a relative path for the database directory. Relative paths can be tricky due to the web server changing the current working directory during operation. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, April 23, 2024 at 08:10 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |