If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ASP Code to connect to SQL Server 2000

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-04, 14:26
JimWa JimWa is offline
Registered User
 
Join Date: Jan 2004
Posts: 40
ASP Code to connect to SQL Server 2000

Can anyone provide a generic connection to SQL Server 2000 via ASP

I am in the process of upsizing to SQL Server and need to learn the new conneciton string vs what I use now for MS Access

Here is my current connection in MS Access:

<% Set objConnST = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("../Database/AmigosHCTracker_TEST.mdb; Password=password")
objConnST.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
strsqST = "SELECT * FROM tbl_Location where State = 'MD' Order By State, CourseName"
Set objRSST = objConnST.Execute(strsqST) %>

Here is what I have so far that is bombing out:

<%
Set objConn4 = Server.CreateObject("ADODB.Connection")
objConn4.open "DSN=sql.93524;UID=golfinamigos;PWD=password;DATAB ASE=amigosSQL"
strsqST = "SELECT * FROM tbl_Location where State = 'MD' Order By State, CourseName"
Set objRSST = objConnST.Execute(strsqST) %>


This is the error:

Microsoft VBScript runtime error '800a01a8'

Object required: 'objConnST'

/AreaCourses/Test_DSN.asp, line 5



Any help would be most appreciated!
Reply With Quote
  #2 (permalink)  
Old 01-22-04, 23:18
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
<%
Set objRSST = objConn4.Execute(strsqST)
%>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On