Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Customized Database cannot be accessed
Message
De
16/02/2006 07:20:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
15/02/2006 22:19:01
Aye Mya Thida Kyaw
Ingenuity Microsystems Sdn Bhd.
Kuala Lumpur, Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01096647
Message ID:
01096697
Vues:
15
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform