|
-
Oct 20th, 2000, 10:41 AM
#1
Thread Starter
Hyperactive Member
I'm trying to connect to a SQL 7 database via an ASP page, but having not luck. I just keep getting this error
Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object
I've created the System DSN file and it works okay. The code I use to try and make a connection is
<%
Set dbase=Server.CreateObject("ADODB.Connection")
dbase.Open "WebCts2000"
%>
but it doesn't work any ideas?
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Oct 20th, 2000, 03:07 PM
#2
Frenzied Member
#1, take note of which line is failing when you get that error message. (may not be the one your expecting)
#2, Your connection string should have "DSN=WebCts2000;uid=username;pwd=password"
You have to specify the username and password, the userid can be saved in the DSN but not the PW.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Oct 20th, 2000, 04:11 PM
#3
Lively Member
This is works for me:
<%
OPTION EXPLICIT
Response.Buffer = true
Server.ScriptTimeOut =360
%>
<!-- #include file="./Include/Constants.asp" -->
<%
Private Sql, ConnString
Private Conn, Cmd, RS
Private blnOpen
ConnString = "Provider=SQLOLEDB.1;" & _
"Persist Security Info=False;User ID=UserID;" & _
"Initial Catalog=DBName;Data Source=SQLServerName"
sql = "Select blah from tblBlah"
Set Conn = Server.CreateObject("ADODB.Connection")
Set Cmd = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject("ADODB.Recordset")
Conn.ConnectionTimeout = 180
Conn.Mode = adModeShareDenyNone
Conn.CursorLocation = adUseClient
Cmd.CommandTimeout = 180
Cmd.CommandType = adCmdText
RS.CursorType = adOpenDynamic
RS.CursorLocation = adUseServer
RS.LockType = adLockOptimistic
Conn.Open ConnString
Set Cmd.ActiveConnection = Conn
Cmd.CommandText = Sql
Set RS.ActiveConnection = Conn
RS.Open Cmd
if err.number <> 0 then
Call Err_Create(err.number, err.description, err.source)
call DestroyObjects
else
blnOpen = True
blnFirstRec = TRUE
end if
if ((RS.eof) OR (not blnOpen)) then
response.write "<BR><CENTER><B>No Records Found " & _
"</B></CENTER><BR>"
else
RS.movefirst
...
Private Sub DestroyObjects
RS.Close
Conn.Close
Set RS = Nothing
Set Cmd = Nothing
Set Conn = Nothing
End Sub
...
%>
-
Oct 20th, 2000, 04:45 PM
#4
New Member
Check carfully if the error not form kod of your client...
it seems like en error of client not of asp kod .
-
Oct 20th, 2000, 06:27 PM
#5
You might make sure MDAC is installed on the server, you can't make an ADO connection without it, it can be downloaded from http://www.microsoft.com/downloads if you don't have it.
-
Oct 21st, 2000, 12:10 AM
#6
Frenzied Member
That actually sound like the most likely culprit...
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|