Skip to main content
GameDev.net gamedev.net
🔒 Locked

ASP & Databases

Started by eddiemjm Jan 15, 2004 at 10:39 AM 0 replies 250+ views
Original Post
eddiemjm
eddiemjm
As a server, can I access databases on XP Professional using ASP on my web site??? The following code is erroneous... why??? sub RegisterInfo() <% Dim adoCon Dim rsAddnewmember Dim strSQL set adoCon=Server.CreateObject("ADODB.Connection") adoCon.Provider="Microsoft.Jet.OLEDB.4.0" adoCon.Open "C:\Inetpub\wwwroot\myweb\prototypefantasyfootballdb.mdb" Set rsAddnewmember = server.createobject("ADODB.Recordset") rsAddnewmember.Open "Select UserTable.LastName from UserTable", adoCon strSQL = "Insert into UserTable(LastName) Values (''" & request.form("LastName") & "'')" response.write(strSQL) adoCon.Execute(strSQL),recordsaffected adoCon.Close Set rsAddnewmember = Nothing Set adoCon = Nothing Response.Redirect "fantasyfootballREGISTERPAGE.asp" %> HELP!!!
Michalson
Michalson
Yes. ADO is the common method.


Set DatabaseConnection = Server.CreateObject("ADODB.CONNECTION")
DatabaseConnection.Open "ADO connection string. Could directly reference a driver and database, or be an ODBC link"

Set DatabaseTable = DatabaseConnection.Execute("SELECT * FROM Users")
do while not DatabaseTable.EOF
Response.Write DatabaseTable.Fields("Name")
DatabaseTable.MoveNext
loop

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.