Using SQLConfigDataSource to access mdb file via ODBC 
Author Message
 Using SQLConfigDataSource to access mdb file via ODBC

I'm trying to call SQLConfigDataSource API to create a
DSN entry to read an Access database from VFP.

The problem is I don't know what string to pass as 4th argument.
I tried "DSN=temp"+CHR(0)+"Description=temp"+CHR(0)+"DBQ=c:\test.mdb"
but it doesn't work.
Example:
err=SQLConfigDataSource(0,1,"Microsoft Access Driver",
"DSN=temp"+CHR(0)+"Description=temp"+CHR(0)+"DBQ=c:\test.mdb")

I successfully created DSN entry for VFP tables in the same way
(the string is obviously different).

Someone can help me?
I can't use a static DSN. I need to call the API to create the entry.

--
Andrea Mariottini



Tue, 30 Aug 2005 01:56:45 GMT  
 Using SQLConfigDataSource to access mdb file via ODBC
Hi, Andrea!
You wrote  on Thu, 13 Mar 2003 18:56:45 +0100:

 AM> Someone can help me?
 AM> I can't use a static DSN. I need to call the API to create the entry.

Maybe you can use DSNless connection?

m.lnHandle = SQLSTRINGCONNECT("Driver=Microsoft Access Driver
(*.mdb);DBQ=C:\Program Files\Microsoft
Office\Office\1033\FPNWIND.MDB;DefaultDir=C:\Program Files\Microsoft
Office\Office\1033;MaxBufferSize=2048;PageTimeout=5;")

The same connection string may be used for Connection object in DBC.

WBR, Igor



Tue, 30 Aug 2005 03:40:41 GMT  
 Using SQLConfigDataSource to access mdb file via ODBC

Quote:

> Maybe you can use DSNless connection?

> m.lnHandle = SQLSTRINGCONNECT("Driver=Microsoft Access Driver
> (*.mdb);DBQ=C:\Program Files\Microsoft
> Office\Office\1033\FPNWIND.MDB;DefaultDir=C:\Program Files\Microsoft
> Office\Office\1033;MaxBufferSize=2048;PageTimeout=5;")

> The same connection string may be used for Connection object in DBC.

Thanks! It works.

--
Andrea Mariottini



Tue, 30 Aug 2005 17:43:52 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ODBC - extracting data from Access .MDB file

2. Using VFP to access VFP tables via ODBC

3. Accessing VFP3 files via ODBC

4. Accessing VFP files via ODBC

5. Fox 2.6 and Access MDB files

6. Talk to ACCESS .MDB files?

7. Reading MS Access .mdb files from VFP

8. can VFP read and write Access MDB files?

9. VFP via Access/ODBC

10. ODBC & SQLConfigDataSource

11. Accessing Access mdb from foxpro?

12. Updating Access table via ODBC from Fox

 

 
Powered by phpBB® Forum Software