Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM Client/Server » View Thread |
Messages 1 to 4 of 4 total |
Mixing Local and Remote Sessions in same thread |
Thu, May 23 2013 10:56 AM | Permanent Link |
John Taylor | Using DBIsam 4.35 client server.
In a thread I want to update a remote table on the server in one procedure and in another procedure I want to update a local table. The database server is running and the function to update the remote table works fine. I am running into a very strange issue when attempting to update the local table using a local session. I quoted the procedure down to the line causing the error. My question is 1) why would an exception be thrown in Q.Sql.Add(......) ??!!, and 2) What the heck does this have to do with the database server, this is a Session with SessionType set to stLocal ? Can anyone spot what I have done wrong ? Here is my procedure: procedure TSubmitManThread.SaveLocalData(p : pFaxSubmitRecord;index : integer;Saved : boolean = true); var S : TDBIsamSession; D : TDBIsamDatabase; Q : TDBIsamQuery; TableName : AnsiString; HaveBlob : boolean; pd : pSubmitDetail; dDate, dTime : TDateTime; begin HaveBlob := FileExists(p^.sAPFZipFile);// sLocalTifFile); TableName := 'Table_OutGoing.sfdata'; pd := p^.sDetailList[index]; S := TDBIsamSession.Create(nil); S.AutoSessionName := true; S.PrivateDir := FLocalPath;//This is c:\users\JT\AppData\Local\Data S.SessionType := stLocal; D := TDBIsamDataBase.Create(nil); D.DataBaseName := '_LocalData'; D.SessionName := S.SessionName; D.Directory := FLocalPath; Q := TDbIsamQuery.Create(nil); try Q.SessionName := S.SessionName; S.Active := true; D.Connected := true; Q.DatabaseName := D.DataBaseName; Q.RequestLive := true; Q.Sql.Add('INSERT INTO ' + AnsiQuotedStr(TableName,'"')); Q.Sql.Add('('); Q.Sql.Add('OFT_DATE_SENT,OFT_TIME_SENT,OFT_FAXRESULT,OFT_RECIPIENT,OFT_COMPANYNAME,OFT_FAXNUMBER,OFT_ROUTING,OFT_PAGES'); Q.Sql.Add(',OFT_COVERNAME,OFT_COVERTITLE,OFT_COVERMEMO,OFT_COVERSENDER,OFT_COVERACTION,OFT_FROMQUEUE'); Q.Sql.Add(',FOLDER,OFT_JOB_KEY,SUBMIT_ID,OFT_MEMO,OFT_BILLCODE,OFT_GROUP'); if HaveBlob then Q.Sql.Add(',OFT_TIFBLOB'); Q.Sql.Add(')'); Q.Sql.Add('VALUES('); Q.Sql.Add('ate,ime,esult,ecipient,ompany,axNumber,outing,ages,overName,overTitle,overMemo'); //exception thrown on the line above //EDBIsamEngineError.ErrorCode = 11294 //E.Message = 'DBISAM Engine Error # 11294 The database 'JOHNTAYLOR-LAP\SFSERVER3' does not exist on the database server at 'JOHNTAYLOR-LAP'' end; Thanks for any help JT |
Thu, May 23 2013 11:21 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | John
Have you tested the code in a non-threaded context? Moving it into the foreground makes it much easier to debug Since I don't use DBISAM these years I can't remember if the problem that existed with params was fixed (I think so but I'm not sure) if not it's worth trying creating the sql into a stringlist and then have Q.SQL.Text := stringlist.Text Final point - what is the exception? Roy Lambert |
Thu, May 23 2013 12:11 PM | Permanent Link |
John Taylor | Roy,
I have another run away thread that is actually throwing an exception during my debugging, I believe the exception is there and not in the thread I'm looking at. This was so bizarre, I should have suspected the unexpected I think I have a handle on it now. Thanks John "Roy Lambert" <roy@lybster.me.uk> wrote in message news:27658568-12B0-4595-8F62-D9598EB46198@news.elevatesoft.com... > John > > > Have you tested the code in a non-threaded context? Moving it into the > foreground makes it much easier to debug > > Since I don't use DBISAM these years I can't remember if the problem that > existed with params was fixed (I think so but I'm not sure) if not it's > worth trying creating the sql into a stringlist and then have Q.SQL.Text > := stringlist.Text > > Final point - what is the exception? > > Roy Lambert > |
Thu, May 23 2013 1:08 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | John
>I have another run away thread that is actually throwing an exception during >my debugging, I believe the exception is there and not in the thread I'm >looking at. This was so bizarre, I should have suspected the unexpected I can well believe that. In the mainform for a threaded app I have {.$DEFINE NOALARMCHECKS} and then all the creation / usage code is wrapped in {$IFDEF NOALARMCHECKS}{$ENDIF} Its reason why my main suggestion was to test in the foreground. >I think I have a handle on it now. Good Roy Lambert [Team Elevate] |
This web page was last updated on Thursday, April 18, 2024 at 10:42 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |