Freshman
Registered User.
- Local time
- Today, 07:53
- Joined
- May 21, 2010
- Messages
- 437
Hi all,
I'm trying to go the DSN-less route for a few databases.
1. mySQL = Working 100%
2. HFSQL got it working with this code: (locally hosted database)
3. My problem is with a Pervasive SQL database (locally hosted database)
This is the connection string if I connect manully:
DSN=MyDatabase;ArrayFetchOn=1;ArrayBufferSize=8;DBQ=CONTEST;OpenMode=0;ClientVersion=10.30.017.000;CodePageConvert=1252;PvClientEncoding=CP1252;PvServerEncoding=CP1252;AutoDoubleQuote=0;
This part of the code works when the connection is cached.
If I exit Access it no longer works giving me an error stating that I'm trying to connect DSN-less and need to setup the DSN in ODBC again - which is what I don't want to do.
tdfLinked1.Connect = "ODBC;DRIVER=Pervasive ODBC Engine Interface;REP=" & strFilePath & ";DSN=" & TestCode & ";DBQ=" & TestCode & ";TABLE=MyTable"
So I also tried the above code I used for the HFSQL database like this:
I does not seem to regognize the Driver name since it does not create it in the ODBC console like it does with HFSQL
From the above you can see I tried a few option.
Anyone with some advice please?
Thanks
I'm trying to go the DSN-less route for a few databases.
1. mySQL = Working 100%
2. HFSQL got it working with this code: (locally hosted database)
Code:
Public Function CreateHFSQLDSN(strDsn)
Dim vAttributes As String
vAttributes = "DSN=" & strDsn & ";REP=C:\PathToLocalDatabase\" & Chr(0)
SQLConfigDataSource 0&, 1, "HFSQL", vAttributes
End Function
3. My problem is with a Pervasive SQL database (locally hosted database)
This is the connection string if I connect manully:
DSN=MyDatabase;ArrayFetchOn=1;ArrayBufferSize=8;DBQ=CONTEST;OpenMode=0;ClientVersion=10.30.017.000;CodePageConvert=1252;PvClientEncoding=CP1252;PvServerEncoding=CP1252;AutoDoubleQuote=0;
This part of the code works when the connection is cached.
If I exit Access it no longer works giving me an error stating that I'm trying to connect DSN-less and need to setup the DSN in ODBC again - which is what I don't want to do.
tdfLinked1.Connect = "ODBC;DRIVER=Pervasive ODBC Engine Interface;REP=" & strFilePath & ";DSN=" & TestCode & ";DBQ=" & TestCode & ";TABLE=MyTable"
So I also tried the above code I used for the HFSQL database like this:
Code:
Public Function CreatePervasiveDSN(strDsn)
Dim vAttributes As String
''vAttributes = "DSN=" & strDsn & ";Description=Pervasive ODBC Engine Interface" & Chr(0)
vAttributes = "DSN=" & strDsn & Chr(0)
''SQLConfigDataSource 0&, 1, "Pervasive ODBC Client Interface", vAttributes
SQLConfigDataSource 0&, 1, "{Pervasive ODBC Engine Interface}", vAttributes
End Function
I does not seem to regognize the Driver name since it does not create it in the ODBC console like it does with HFSQL
From the above you can see I tried a few option.
Anyone with some advice please?
Thanks