...

View Full Version : some help needed



oneeyebrow
03-11-2006, 09:05 AM
can anyone help me fix this coding

<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("MyData.mdb") & ";"
objConn.Open
%>

<%
DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "tblContact", objConn, , adLockOptimistic, adCmdTable

objRS.AddNew
objRS("Email") = Request.Form("Email")
objRS("FirstName") = Request.Form("FirstName")
objRS("LastName") = Request.Form("LastName")
objRS("Comments") = Request.Form("Comments")
objRS("DateContacted") = Date()
objRS.Update
%>

<p>
<%
DIM strFirstName
strFirstName = Request.Form("FirstName")
%>,<br>
</p>

<%
objRS.Close
Set objRS = Nothing
objCONN.Close
Set objCONN = Nothing
%>

I get the error message

"ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/Sample/confirm.asp, line 13"

edit*I copied the code on this site just so I can re-learn asp - http://www.aspwebpro.com/aspscripts/records/insertnew.asp

edit*I just read on http://support.microsoft.com/default.aspx?scid=kb;en-us;Q254517 that I should Use the actual constant values. How do I find the value of adCmdTable?

BaldEagle
03-12-2006, 02:52 AM
google adovbs.inc. Download the file when you find it and then you can "include" it in your files or if you want you can manually get the values out of it and use them. Include is better though.

BaldEagle



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum