Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql server connection problem
Message
From
14/12/2006 09:45:51
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Sql server connection problem
Miscellaneous
Thread ID:
01177584
Message ID:
01177584
Views:
56
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
Map
View

Click here to load this message in the networking platform