Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get Setup to add the data source to ODBC?
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00119564
Message ID:
00121034
Views:
24
The following program worked:
-----------------------------------------------------
DECLARE Integer SQLConfigDataSource in odbccp32.dll;
Integer, Integer, String, String
settings="DSN=aw40"+chr(0)+;
"Description=ESDK autotest DB"+chr(0)+;
"SourceDB=c:\aw20\aw20.dbc"+chr(0)+;
"SourceType=dbc"

Success=SQLConfigDataSource(0,1,"Microsoft Visual FoxPro Driver",settings)
?
? success

--------------------------------------------------
I just need to pass a parameter for the SourceDB instead of the hard-coded
path of the database. Thanks for your help.

Don


>I will work on it but meanwhile you can read help odbc help file for details.
>
>Bye
>Jayesh
>
>
>>I tried the following and got a return code of zero for Success. I must be missing something. Any ideas? Thanks. Don.
>>
>>DECLARE Integer SQLConfigDataSource in odbccp32.dll;
>>Integer, Integer, String, String
>>settings="DSN=aw30"+chr(0)+;
>>"Description=ESDK autotest DB"+chr(0)+;
>>"Server=d:\aw20\aw20.dbc"
>>clear
>>Success=SQLConfigDataSource(0,1,"Visual FoxPro Database",settings)
>>?
>>? success
>>
>>>Hi Don,
>>>
>>> Try this.
>>>
>>>
>>>DECLARE Integer SQLConfigDataSource in odbccp32.dll ;
>>> Integer, Integer, String, String
>>>settings="DSN=My Oracle DB"+chr(0)+;
>>> "Description=Oracle 73 Test"+chr(0)+;
>>> "Server=MyDbName"
>>>clear
>>>Success=SQLConfigDataSource(0,1,"Oracle73",settings)
>>>?
>>>? success
>>>
>>>Good Luck
>>>Jayesh
>>>
>>>
>>>>Is there a way to not only have the database installed by Setup, but also to have the ODBC administrator run and add the database as a datasource so I can access the data from my Visual C++ program without first running the ODBC administrator separately. The end user would not appreciate doing this in a typical setup, therefore, I want it to be done by the VFP Setup so it is transparent to the user.
>>>>
>>>>Example:
>>>>
>>>>I have a Visual C++ exe that accesses the aw20.dbc VFP 3.0 database. I had to go to the 32bit ODBC administrator and add aw20 as a data source with Visual FoxPro as the driver before I could run my program and access the database. I want to be able to do that using the setup program or by calling SQLConfigDataSource so the end user doesn't have to mess with ODBC setup.
>>>>
>>>>Thanks for any help. Don West.
Previous
Reply
Map
View

Click here to load this message in the networking platform