By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 816 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Manipulate Visual Foxpro database with VB 6

P: 13
Please help me, I have been given a project in VB 6 and the database that I should connect and manipulate with is made from Visual Foxpro database. Is this possible, can you guys teach me how? Please… Thanks.
Sep 6 '07 #1
Share this Question
Share on Google+
2 Replies


pureenhanoi
100+
P: 175
Please help me, I have been given a project in VB 6 and the database that I should connect and manipulate with is made from Visual Foxpro database. Is this possible, can you guys teach me how? Please… Thanks.
create a connection via ODBC data source.
Open Control Panel\Administrative Tools\Data Source (ODBC)
on the System DSN tab, click Add...
Choose "Microsoft Visual Foxpro Dirver" and click Finish.
name the data source as "TempDSN"
Browse to Foxpro database and click finish again.
Now, you have a DSN connection.

From Visual Basic:

Dim cnxn as New ADODB.Connection
Dim rs As New ADODB.Recordset

cnxn.ConnectionString="DSN=TempDSN"
cnxn.Open
sql = "SELECT * FROM ..."
Set rs=cnxn.Excute(sql)
Sep 6 '07 #2

P: 13
create a connection via ODBC data source.
Open Control Panel\Administrative Tools\Data Source (ODBC)
on the System DSN tab, click Add...
Choose "Microsoft Visual Foxpro Dirver" and click Finish.
name the data source as "TempDSN"
Browse to Foxpro database and click finish again.
Now, you have a DSN connection.

From Visual Basic:

Dim cnxn as New ADODB.Connection
Dim rs As New ADODB.Recordset

cnxn.ConnectionString="DSN=TempDSN"
cnxn.Open
sql = "SELECT * FROM ..."
Set rs=cnxn.Excute(sql)
Thanks for the Help...
Sep 10 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.