Associate
- Joined
- 14 Jun 2009
- Posts
- 43
- Location
- Mare Tranquilitas
Hello all,
I'm currently having problems getting a script to connect to a SQL database. The error message returned is:
[DBNETLIB][Connection Open (connect()).]SQL Server does not exist or access denied Code 80004005
I have tried tonnes of different scripts with different ways to connect. What I have used is shown below. The host is Dreamhost. Any pointers would be greatfully appreciated. This VBscript is running from a normal workstation; the SQL database is not local if that helps.
I'm currently having problems getting a script to connect to a SQL database. The error message returned is:
[DBNETLIB][Connection Open (connect()).]SQL Server does not exist or access denied Code 80004005
I have tried tonnes of different scripts with different ways to connect. What I have used is shown below. The host is Dreamhost. Any pointers would be greatfully appreciated. This VBscript is running from a normal workstation; the SQL database is not local if that helps.
Code:
dim sServer, sConn, oConn,oRS
sServer="sql.landingapollo.com"
sConn="provider=sqloledb;data source=" & sServer & ";initial catalog=avgcheck"
Set oConn = CreateObject("ADODB.Connection")
oConn.Open sConn, "usernameremoved", "passwordremoved"
Set oRS =CreateObject("ADODB.Recordset")
sSQL="insert into table_1(test1,test2,test3,test4,test5) values('" & resultavgcorrect & "','" & resultavgcorrect & "','" & resultavgcorrect & "','" & resultavgcorrect & "','" & resultavgcorrect & "')"
ors.open sSQL, oconn