Hey guys,
I finished my comic book database project, or so I thought. When I go to upload the files and make a new SQL 2005 DB, I'm having some trouble connecting to it from my index.asp page.
I'm getting this error:
"[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
I'm using their suggested/given connection string:
"workstation id=ComicsDB.mssql.somee.com;packet size=4096;user id=[myusernamehere];pwd=[mypasswordhere];data source=ComicsDB.mssql.somee.com;persist security info=False;initial catalog=ComicsDB"
Here's initial connector code I'm trying to use:
<%
strSQL = "Select * from Info ORDER BY Title ASC;"
SET DbObj = Server.CreateObject("ADODB.Connection")
DbObj.Open = "data source=ComicsDB.mssql.somee.com;packet size=4096;user id=[myusernamehere];pwd=[mypasswordhere];persist security info=False;initial catalog=ComicsDB"
SET oRs = DbObj.Execute(strSQL)
%>
What I'm also confused about, was when I contacted their support about it, he said I was using an ODBC connector, which isn't supported on somee.com and he said to try using an ADO or ADO.NET connection instead. But I thought this was an ADO connection.....???
I did try another connection method, which 'should' be an ADO connection:
<%
strSQL = "Select * from Info ORDER BY Title ASC;"
Dim DbObj as ADODB.Connection
Set DbObj=New ADODB.Connection
Let DbObj.ConnectionString= "ODBC;DSN=" & ComicsDB.mssql.somee.com & ";UID=" &
[myusernamehere] & ";PWD=" & [mypasswordhere]
DbObj.Open
SET oRs = DbObj.Execute(strSQL)
%>
But when I use that code, I always get this error:
"Microsoft VBScript compilation error '800a0401'
Expected end of statement
/index.asp, line 10
Dim DbObj as ADODB.Connection"
----------^
Can anyone help me clear this sql connection up?
Thanks in advance!
Jerome