Hello everybody,
Please somebody help me...I am trying to save webpage data on the access database (remote server)...on the local host everything is going fine....but when i m loading my web page on remote server and trying to save the data to the ms access database then i could not save it in the database.....
Problem is that i m not getting any error even ....on clicking on save button the page is navigating on the other webpage showing successfully data is saved but when i m checking in the database no new data is saved in it.....please somebody help me with this.....i m using following codes:

---
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("Mypgdb.mdb")

sql= "Insert into UserDetail( FirstName, LastName, UserName, uPassword, Email, uPhone, Address, City, State, PostalCode, uRole, Course, RDate) VALUES ('" & T & "',' " & Co & "','"& Ss & "','" & Sp & "','" & Sc & "','" & Po & "','" & Pr & "','" & I & "','" & Mn & "','" & Con & "','" & Sr & "','" & Sg & "','" & Dt & "')"

sql1="select * from UserDetail WHERE UserName ='" & Ss & "'"

Conn.Execute(sql)

Set Rs = Nothing
conn.Close
Set Conn = Nothing
%>

Make sure that your server.MapPath path is correct. This means that this page has to be in the same directory as the database. That lies within your "Server.MapPath("Mypgdb.mdb") portion. Also make sure that your database has write permissions, and that your folder has write permissions as well. Also, check your connection string, it should be this:

Conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source='" & Server.MapPath("Mypgdb.mdb") & "'"

Hi,
Thanks for yr reply
I have checked everything.....everything is fine with permission and connection string...and database is also in the same directory .....

when i m running these codes no error is generated ......but i m not getting and data in my database after running these codes...

Make sure that your server.MapPath path is correct. This means that this page has to be in the same directory as the database. That lies within your "Server.MapPath("Mypgdb.mdb") portion. Also make sure that your database has write permissions, and that your folder has write permissions as well. Also, check your connection string, it should be this:

Conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source='" & Server.MapPath("Mypgdb.mdb") & "'"

check to make sure your data type of the fields. Keep in mind that all strings must have single quotes, like you have. However, all integers must have NO QUOTES otherwise it will not insert.

Integer = (" & int & ")

String = ('" & str & "')

However, if it works locally and not on the server, then it has to do with settings and permissions. Double check to make sure you didn't change anything while transitioning over to the net. If you did, check what you changed for a problem.

This article has been dead for over six months. Start a new discussion instead.