General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
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
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only