Advertisement Jump to content

Archived

This topic is now archived and is closed to further replies.

eddiemjm

ASP & Databases

This topic is 5485 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!!!

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!