FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour File name .sqlite3 not work with FW_OpenAdoConnection
Posts: 130
Joined: Fri Jun 30, 2006 02:14 PM
File name .sqlite3 not work with FW_OpenAdoConnection
Posted: Sun Jul 25, 2021 02:08 PM
When i use
Code (fw): Select all Collapse
oCn:=FW_OpenAdoConnection("name.db")

works fine,
but i have to access data to a db sql lite 3 named "name.sqlite3", and
Code (fw): Select all Collapse
oCn:=FW_OpenAdoConnection("name.sqlite3")

doesn't work!
And i can't rename the file, because it is in use by another third-party application.
How can I solve it in the best way?
Thank you.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: File name .sqlite3 not work with FW_OpenAdoConnection
Posted: Sun Jul 25, 2021 02:56 PM

Have you tried "name.sqlite3.db" ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 195
Joined: Sun Jul 22, 2012 07:01 PM
Re: File name .sqlite3 not work with FW_OpenAdoConnection
Posted: Sun Jul 25, 2021 10:19 PM
Antonio,

Changing to a .db extension would work, except he has already stated he can't change the name.

But the reason .sqlite3 doesn't work is this extension is not one of the explicitly allowed list of extensions in FW_AdoConnectionString():

Code (fw): Select all Collapse
   if '.' $ c
      cExt     := Lower( cFileExt( c ) )
      if cExt == "db"
         cRDBMS      := "SQLITE"; aSpec[ 3 ] := c; c := ''
      elseif cExt $ "mdb,accdb"
         cRDBMS      := "MSACCESS"
      elseif cExt == "db"
         cRDBMS      := "SQLITE"
      else
         return ""
      endif
Posts: 130
Joined: Fri Jun 30, 2006 02:14 PM
Re: File name .sqlite3 not work with FW_OpenAdoConnection
Posted: Mon Jul 26, 2021 06:53 AM

Antonio,
i confirm: even with 'name.sqlite3.db' it doesn't work, and I can't change the file name unfortunately.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: File name .sqlite3 not work with FW_OpenAdoConnection
Posted: Mon Jul 26, 2021 09:41 AM
Please try
Code (fw): Select all Collapse
FW_OpenAdoConnection( { "SQLITE", "name.sqlite3" } )


OR

Code (fw): Select all Collapse
FW_OpenAdoConnection( "SQLITE,name.sqlite3")
Regards



G. N. Rao.

Hyderabad, India
Posts: 130
Joined: Fri Jun 30, 2006 02:14 PM
Re: File name .sqlite3 not work with FW_OpenAdoConnection
Posted: Mon Jul 26, 2021 10:16 AM

Mr. Rao,
unfortunately both don't work.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: File name .sqlite3 not work with FW_OpenAdoConnection
Posted: Tue Jul 27, 2021 02:18 PM
Code (fw): Select all Collapse
   cStr  := "Provider=MSDASQL;Driver=SQLite3 ODBC Driver;Server=;Database=name.sqlite3;User=admin;Password=;"
   oCn   := FW_OpenAdoConnection( cStr )
Regards



G. N. Rao.

Hyderabad, India
Posts: 130
Joined: Fri Jun 30, 2006 02:14 PM
Re: File name .sqlite3 not work with FW_OpenAdoConnection
Posted: Tue Jul 27, 2021 02:48 PM

Mr. Rao,
ok!
Thank you.

Max

Continue the discussion