Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql server connection problem
Message
De
14/12/2006 09:45:51
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Sql server connection problem
Divers
Thread ID:
01177584
Message ID:
01177584
Vues:
57
Hello All,
I am having this strang problem. I am trying to connect to SQL Server on the internet using asp command in asp pages like this:
SQLConnection="Provider=SQLOLEDB;" &_
"Data Source=sql.mydomain.com;" &_
"Initial Catalog=catg;" &_
"user id=myuser;" &_
"password=mypass;"

Set dbConnection = Server.CreateObject("ADODB.Connection")
dbConnection.Open SQLConnection

It connects perfectly without any problem.

But when I try to connect the same server and database through vfp using this commands:
public cn as ADODB.Connection,rs as ADODB.Recordset,nHandle
cn = CREATEOBJECT('ADODB.Connection')
cn.ConnectionString = "Provider=SQLOLEDB;Data Source=sql.mydomain.com;Initial Catalog=catg;user id=myuser;password=mypass;"
cn.open
It gives 'SQL Server does not exist or access denied' error.

I tried with this command also:
SQLStringConnect("Provider=SQLOLEDB;Data Source=sql.mydomain.com;Initial Catalog=catg;user id=myuser;password=mypass;")

But same result.
Please tell me what am I doing wrong?

Thanks in advance

Suvi Joseph
Répondre
Fil
Voir

Click here to load this message in the networking platform