Fry Posted May 22, 2006 Share Posted May 22, 2006 i fellowed the tutorial from ADO tutiral. in one chapter it teaches how to insert value to the table. i use the following code, but i got error: 3708, can anyone help?i have give permission to the account so that it is allowed to modify the mdb file. set conn = Server.CreateObject("ADODB.Connection")conn.Provider = "Microsoft.Jet.OLEDB.4.0"conn.Open "C:\Inetpub\wwwroot\test\test.mdb"sql = "INSERT INTO userAccount (user, password) value (" sql = sql & "'" & Request.Form("user")& "'"sql = sql & ", '" & request.Form("password") & "')"'on error resume nextconn.Exceute sql, recaffectedif err<>0 then response.Write("no update permissions!") response.Write(err)else response.Write(recaffected & " recorded added")end ifconn.close Link to comment Share on other sites More sharing options...
Jack McKalling Posted May 22, 2006 Share Posted May 22, 2006 I don't know ADO, but shouldn't the mdb file be located at the server instead of your computer? Just a guess Link to comment Share on other sites More sharing options...
Sh89 Posted May 22, 2006 Share Posted May 22, 2006 Try Thistempuser=Request.Form("user")temppass=Request.Form("password")sql="INSERT INTO userAccount (user, password) values ('"&tempuser&"', '"&temppass&"')"This will definitely help you! Link to comment Share on other sites More sharing options...
pulpfiction Posted May 22, 2006 Share Posted May 22, 2006 Hi Fry,Just to make sure that we have the correct SQL statement, print the statement once and check...sql = "INSERT INTO userAccount (user, password) value (" sql = sql & "'" & Request.Form("user")& "'"sql = sql & ", '" & request.Form("password") & "')"response.write(sql)With this you can make sure that you have a correct statement.... Link to comment Share on other sites More sharing options...
Fry Posted May 22, 2006 Author Share Posted May 22, 2006 tried all the suggestion from above. the query was fine. there must be something else that prevent me from added data to database.Note: i could read the database. but i can't write, and i have configure the file so then it is allowed to write by internet user. Link to comment Share on other sites More sharing options...
jojay Posted May 22, 2006 Share Posted May 22, 2006 tried all the suggestion from above. the query was fine. there must be something else that prevent me from added data to database.Note: i could read the database. but i can't write, and i have configure the file so then it is allowed to write by internet user.<{POST_SNAPBACK}> Right click on the folder where the database file is residing, then click Security tab, and give permission for Internet Guest Account - you may give (modify, read, write) or Full Control which includes all these....as you wish, and I think that should help this issue. Link to comment Share on other sites More sharing options...
Fry Posted May 23, 2006 Author Share Posted May 23, 2006 Right click on the folder where the database file is residing, then click Security tab, and give permission for Internet Guest Account - you may give (modify, read, write) or Full Control which includes all these....as you wish, and I think that should help this issue.<{POST_SNAPBACK}> tried that, the internet user has full control over the file, but still doens't work.do u use ms acess as database or mySQL or SQL server or Oracle? Link to comment Share on other sites More sharing options...
jojay Posted May 23, 2006 Share Posted May 23, 2006 tried that, the internet user has full control over the file, but still doens't work.do u use ms acess as database or mySQL or SQL server or Oracle?<{POST_SNAPBACK}> MS Access....It worked for me then what OS are you using? based on that, do a search in google. What is the error msg u r getting? Can you post the error msg? Link to comment Share on other sites More sharing options...
Fry Posted May 24, 2006 Author Share Posted May 24, 2006 MS Access....It worked for me then what OS are you using? based on that, do a search in google. What is the error msg u r getting? Can you post the error msg?<{POST_SNAPBACK}> i am using win xp, ms access 2003, this is the error: **Error Type: ADODB.Connection (0x800A0E7C) Parameter object is improperly defined. Inconsistent or incomplete information was provided /test/sqlAddRow.asp, line 12**any clue? Link to comment Share on other sites More sharing options...
pulpfiction Posted May 24, 2006 Share Posted May 24, 2006 are you using exactly the code you posted in the post#1, if thats true then there's a spelling mistake. just check this, i guess that would throw different error..you have written ["Exceute" for "Execute"]conn.Exceute sql, recaffected Link to comment Share on other sites More sharing options...
jojay Posted May 24, 2006 Share Posted May 24, 2006 If you still get error message, try to response.write and see .below the sql statement, write the code after sql statement:response.write sql Link to comment Share on other sites More sharing options...
jojay Posted May 24, 2006 Share Posted May 24, 2006 Where is your recordset object? shouldn't you have like this: set conn = Server.CreateObject("ADODB.Connection")conn.Provider = "Microsoft.Jet.OLEDB.4.0"conn.Open "C:\Inetpub\wwwroot\test\test.mdb"sql = "INSERT INTO userAccount (user, password) value (" sql = sql & "'" & Request.Form("user")& "'"sql = sql & ", '" & request.Form("password") & "')"Set rs = Server.CreateObject("ADODB.Recordset")rs.open sql, conn,3,3 Link to comment Share on other sites More sharing options...
Fry Posted May 24, 2006 Author Share Posted May 24, 2006 .. Link to comment Share on other sites More sharing options...
pulpfiction Posted May 24, 2006 Share Posted May 24, 2006 I guess you dont need a Recordset object for an INSERT command, Hey Fry try this,conn.Execute SQL instead of [remove recaffected] conn.Exceute sql, recaffectedThen goto the DB and check if a row is added. Link to comment Share on other sites More sharing options...
Fry Posted May 24, 2006 Author Share Posted May 24, 2006 thanks everyone for all the great help. especially thanks to pulpfiction for detecting my spelling mistake on "conn.Exceute sql"i have solved the problem spelling was one of the mistake, but i also used 2 reseved words in my querry and in my table, thats why it didn't work. i changed the table name column name, now the insert query works Link to comment Share on other sites More sharing options...
jojay Posted May 24, 2006 Share Posted May 24, 2006 If you dont get through still, then try the below code: conn.Provider="Microsoft.Jet.OLEDB.4.0; Data" & _ "Source=c:\Inetpub\wwwroot\test\test.mdb" Link to comment Share on other sites More sharing options...
Fry Posted May 24, 2006 Author Share Posted May 24, 2006 If you dont get through still, then try the below code:conn.Provider="Microsoft.Jet.OLEDB.4.0; Data" & _ "Source=c:\Inetpub\wwwroot\test\test.mdb" <{POST_SNAPBACK}> thanks, the problem was resolved, it was the spelling and reserved words problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now