>I created a database with SQL Server 2000 SP3a. I am trying to access it from Visual Foxpro 9.0. The database that I created is not under Northwind. I tried to connect ADO by using connection string which is
>
>Provider=SQLOLEDB.1;Password=abc123;Persist Security Info=True;User ID=sa;Initial Catalog=test;Data Source=AYEMYA;
>
>But I still cannot see the tables from my database yet. Is there any possible way to access my database. Hope someone can suggest me. Thanks in advance.
>
>Mya.
First of all it's not wise to use userid and pwd in a connection string. Use trusted connection instead.
1)
lnHandle = SQLStringConnect("Driver={SQL server};server=AYEMYA;Trusted_connection=yes")
SQLExec(m.lnHandle,"select * from myDabase..myTable","myCursor")
SQLDisconnect(m.lnHandle)
select myCursor
browse
2)
loCon = createobject('AdoDb.Connection')
loCon.ConnectionString = "Provide=SQLOLEDB;Data Source=AYEMYA;Trusted_connection=yes"
loCon.Open
loRS = loCon.Execute("select * from myDabase..myTable")
? loRs.Fields(0).Value
loCon.Close
Cetin