Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Sql server connection problem
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement