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!

Remotely updating one database row ..

Status
Not open for further replies.

Autosys

Programmer
Jun 1, 2004
90
GB
Hi All

I was hoping you could give me some advice.

I've written the little piece of code below in an attempt to update one row in my database which sits on my remote web server.

I have saved the below code to a file called: test.html, but I dont get an error when I double click the file, but the row also doesn't get updated in my database.

Any ideas?

<%@LANGUAGE=VBSCRIPT%>
<%
Option Explicit
Dim strConnection, conn, rs, strSQL

strConnection = "Provider=sqloledb;Data Source=servername;" & _
"Initial Catalog=MYDB;User Id=vabsie;Password=kr00nstadmi6;"

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConnection

Set rs = Server.CreateObject("ADODB.recordset")
strSQL = "update tbl_users set username='vabsie' where username='sss' commit"
rs.open strSQL, conn, 3,3

rs.Close
Set rs = Nothing

conn.Close
Set conn = Nothing
%>
 
Well without scrutinizing all our code, it looks like this is ASP code so i would change the test.html to test.asp for starters. make sure your web server can execute ASP, its an installable feature in IIS. Then i would open a web browser and go as it needs to be executed through the server, cant just double click it, ASP code doesnt execute like that.



RoadKi11

"This apparent fear reaction is typical, rather than try to solve technical problems technically, policy solutions are often chosen." - Fred Cohen
 
Thanks mate .. took your advice, changed my page to .asp and made lots of progress since then.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top