By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,830 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,830 IT Pros & Developers. It's quick & easy.

Need Help about inserting record in Access DATABASE

P: 2
Hi friends here is my coding.. but i m facing one problem .. i used both mathod SQL mathod and open Record Set. but in both i m getting error massage can anyone help me out regarding thi.

Please Please Please help me out how i can solve this problem.


Error :
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/grc/registration.asp, line 85



Coding :
<%
dim conn, connstring
dim errdc,QSql,Qval
dim DataSuccess
dim UNameTT,PassTT,FNameTT,LNameTT, EmailTT,AgeTT,GenderTT,Address1TT,Address2TT,CityT T,StateTT,CountryTT,PhoneTT,MobileTT,FaxTT

set conn = server.createobject("ADODB.connection")
connstring = "provider = microsoft.jet.OLEDB.4.0; data source = " & server.mappath("data.mdb")
conn.open = connstring
UNameTT = request.form("Uname")
PassTT = request.form("PassT")
FNameTT =request.form("Fname")
LNameTT = request.form("LName")
EmailTT = request.form("EmailT")
AgeTT = request.form("AgeT")
GenderTT = request.form("Gender")
Address1TT = request.form("Address1")
Address2TT = request.form("Address2")
CityTT = request.form("CityT")
StateTT = request.form("StateT")
CountryTT = request.form("CountyT")
PhoneTT = request.form("phoneT")
MobileTT = request.form("MobileN")
FaxTT = request.form("FaxT")

set rs = server.CreateObject("adodb.recordset")
rs.Open "SELECT * from users",Conn,adOpenKeyset, adLockPessimistic, adCmdText
rs.addnew
rs.fields("UserName") = UnameTT
rs.fields("Password") = PAssTT
rs.fields("FName") = FnameTT
rs.fields("LName") = LNameTT
rs.fields("Email") = EmailTT
rs.fields("Age") = AgeTT
rs.fields("Gender") = GenderTT
rs.fields("Address1") = Address1TT
rs.fields("Address2") = Address2TT
rs.fields("City") = CityTT
rs.fields("State") = StateTT
rs.fields("Country") = CountryTT
rs.fields("Phone") = PhoneTT
rs.fields("Mobile") = MobileTT
rs.fields("Fax") = FaxTT
rs.update

' Method 2 using excute SQL command but error : Syntex Error in INSERT INTO
'set rs = conn.execute ("INSERT INTO Users (UserName, Password, Fname, LName, Email, Age, Gender, Address1, Address2, City, State, Country, Phone, Mobile, Fax) VALUES ('" & UNameTT & "','" & PassTT & "','" & FNameTT & "','" & LNameTT & "','" & EmailTT & "'," & AgeTT & ",'" & GenderTT & "','" & Address1TT & "','" & Address2TT & "','" & CityTT & "','" & StateTT & "','" & CountryTT & "','" & PhoneTT & "','" & MobileTT & "','" & FaxTT & "');")

' Method 2 using open SQL command but error : Syntex Error in INSERT INTO

'rs.open "Insert into Users(UserName,Password,Fname,LName,Email,Age,Gend er,Address1,Address2,City,State,Country,Phone,Mobi le,Fax) VALUES('UNameTT','PassTT','FNameTT','LNameTT','mai lTT',55,'GenderTT','Address1TT','Address2TT','City TT','StateTT','CountryTT','PhoneTT','MobileTT','Fa xTT')",conn

end if
rs.close
set rs = nothing
conn.close
set conn = nothing
end if
May 20 '07 #1
Share this Question
Share on Google+
3 Replies


jhardman
Expert 2.5K+
P: 3,405
set rs = server.CreateObject("adodb.recordset")
rs.Open "SELECT * from users",Conn,adOpenKeyset, adLockPessimistic, adCmdText
rs.addnew
rs.fields("UserName") = UnameTT
rs.fields("Password") = PAssTT
rs.fields("FName") = FnameTT
rs.fields("LName") = LNameTT
rs.fields("Email") = EmailTT
rs.fields("Age") = AgeTT
rs.fields("Gender") = GenderTT
rs.fields("Address1") = Address1TT
rs.fields("Address2") = Address2TT
rs.fields("City") = CityTT
rs.fields("State") = StateTT
rs.fields("Country") = CountryTT
rs.fields("Phone") = PhoneTT
rs.fields("Mobile") = MobileTT
rs.fields("Fax") = FaxTT
rs.update
In this method, where is the error generated? It should come on a specific line.
Jared
May 21 '07 #2

P: 2
Thanks buddy.. i solved this problem it was problem with my iis server i just put rights for internet guest user to write date access and its solved. coz there is no mistak in my script just server didnt allow users to wirte access. thankx anyways..
May 25 '07 #3

jhardman
Expert 2.5K+
P: 3,405
I'm glad you solved the problem. Thanks for posting your solution.

Jared
May 28 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.