Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Connection Error

Status
Not open for further replies.

fdsouth

Technical User
Jun 6, 2001
61
US
Can anyone tell me what is wrong with the following lines?

Code:
<script LANGUAGE = &quot;VBScript&quot;>

Option Explicit

Dim objDB
Dim objRS
Dim sDBName
Dim sAction
Dim sRowColor
Dim html
Dim sql
Dim sError

sDBName = &quot;driver={Microsoft Access Driver (*.mdb)};dbq=F:\catalog.mdb&quot;
Set objDB = Server.CreateObject(&quot;ADODB.Connection&quot;)
objDB.Open sDBName
.
.
.
</script>

I keep getting an error in the line defining sDBName that states &quot;Variable is undefined: 'Server'&quot; when I try to launch the page. I'm new at ASP programming, so please have patience with these basic questions.

Thanks.
 
change your first line to this:

<script LANGUAGE = &quot;VBScript&quot; RUNAT=SERVER>

Alternatively, you could drop all the <script> tags, and just use
<%
code goes here
%>

hth
leo leo
 
I changed the first line to what you suggested and still received the same error message. I'm running this locally from a workstation for debugging before I post it to our web site at our ISP. I did set up an ODBC link to the database (although I think I set up the DNSless connection correctly), but that didn't help.

I'm stumped.
 
You say you're running this locally from a workstation. You must be running this on a webserver - either full-blown IIS or Personal Web Server (PWS).
 
Yes, I finally figured that out last night when reading through a text I have on ASP.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top