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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anyone see anything wrong here?

Status
Not open for further replies.

bjm027

MIS
Mar 7, 2003
59
US
I have a web page that has a form that is requesting information from a user (Request.asp). I am new with ASP and was just kind of brought in on this project. But I have looked over the code over and over again and cannot find the error. The error is when the user comes to the point to submit the information by clicking the submit button, it brings you to this:[but is suppose to bring you to RequestConfirm.asp]

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

/ResponseTeam/RequestConfirm.asp, line 255

Is it something in here:

Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail.mail.org" ' Specify a valid SMTP server
Mail.From = "ResponseTeamRequest@techcouncilnwpa.org" ' Specify sender's address

Mail.AddAddress rs3("Email")

Mail.Subject = "Broadband Response Team - Assistance Request"
Mail.Body = strSubject2

On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write &quot;Error encountered: &quot; & Err.Description
End If

Let me know what you think or explain that error I am getting. Thanks in advanced.

 
nothing dumps out as wrong in the few lines there. which line is 255? and have you tried data type conversions to correct the error description. eg: cStr,cInt,cLng etc... around variables

_________________________________________________________
$str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
$Nstr = ereg_replace(&quot;sleep&quot;,&quot;coffee&quot;,$str); echo $Nstr;

onpnt2.gif
[/sub]
 
That error indicates a Microsoft Access database error. As indicated in this line you posted Mail.AddAddress rs3(&quot;Email&quot;)
the file uses some ADO objects prior to the code you posted. The error is in that code not what you posted.

-pete
 
[cannon]

I thought of that also and you could test it fairly simple by placing a email address hardcoded in there!

_________________________________________________________
$str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
$Nstr = ereg_replace(&quot;sleep&quot;,&quot;coffee&quot;,$str); echo $Nstr;

onpnt2.gif
[/sub]
 
So are you saying I could post for example my email address here:
Mail.AddAddress rs3(&quot;My address&quot;)

and also how about this function and code:

<%
Function Change(strDesc)
'This function replace a single apostrophe with a ^ so the field can be saved to the database.
Change = strDesc
Change = Replace(Change, &quot;'&quot;, &quot;~&quot;)
End Function
%>
<%
If Request.Form...
repsonse.write...
%>
Else
%>
<%
Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
conn.open &quot;SWAT&quot;
Set Session(&quot;SWAT_conn&quot;) = conn
...

and there also this one that executes some INSERT and UPDATE sql:
<%
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Set rs = conn.Execute(sql)
Set rs69 = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Set rs69 = conn.Execute(sql69)
%>

Sorry such broad questions?
 
no! I meant
Mail.AddAddress &quot;you@domain.com&quot;

The code you posted above is not complete and really doesn't help much. The code that should be in question is the code as palbano said SELECT's the value from the DB populating rs(&quot;Email&quot;)

_________________________________________________________
$str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
$Nstr = ereg_replace(&quot;sleep&quot;,&quot;coffee&quot;,$str); echo $Nstr;

onpnt2.gif
[/sub]
 
Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
conn.open &quot;SWAT&quot;
[red]Set Session(&quot;SWAT_conn&quot;) = conn[/red]


Someone Call the ADO Police!!!!!

Please go look at the FAQs in this forum for working with ADO Database Objects. Start with the first two FAQs on the list and then look at any others you might need before proceeding

-pete
 
It’s been a while. Busy with other stuff. But I got to it and…..
Well I finally buckled down and learned some ASP. I picked at the code piece by piece and find out it wasn’t executing a sql statement.
----------------
sql = &quot;INSERT INTO requests.form(&quot;ID&quot;)&quot;
----------------

I really don’t know what was going on there.
So what I did was declare a variable.
--------------
Dim SavID
SavID = Request.Form(&quot;ID&quot;)
--------------

and changed the sql statement to...
-------------
sql = &quot;INSERT INTO requests (ID) VALUES(&quot; & SavID & &quot;)&quot;
-------------

Everything else worked fine. It stored the values into the database and even mailed the request to myself after I changed the email addresses in the appropriate table.

Anyways. Thank for the help. I thought it would be something different before. But I learned and I am still learning….

Hey do you know of any good asp reference books I should look into…
I know there is a bunch but maybe get some ideas from the experts….

Thanks
 
you know, I think the best resource I can suggest is to take a few hours and start reading threads back in this forum. You will get sytnax, logic, workflow and optimization examples left and right in a real world situation.

I've read
&quot;Beginning ASP Database&quot;
John Kauffman, Kevin Spencer, Thearon Willis

the book says beginning but later goes into advanced techniques


____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-2924

onpnt2.gif
 
seems the error is in your query criteria, probably specified quotes around the record ID in the where statement or something

your code is failing before you even have a recordset, look at where you make your MS_SQL statement at and look at it close, perhaps do a few response.writes on it to see how exactly it's syntaxed.

and if you can post the SQL statement, or the variable assignment of it, that would help more.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top