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

database update

Status
Not open for further replies.

tuam1234

Technical User
Feb 6, 2004
52
IE
i appreciate all replies!!!

does anyone know why im getting this error...
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
/paycheck3.asp, line 74

the line in relation to this eror is:
data1.Open query1, conn

the code is:
<%

'Dimension variables
Dim connection
Dim check
Dim data
Dim insert
Dim query


Set connection = Server.CreateObject("ADODB.Connection")

connection.Open("credit")

Set data = Server.CreateObject("ADODB.RecordSet")

query = "SELECT * FROM credInfo "
data.CursorType=2
data.LockType=3
data.Open query, connection
data.AddNew

data.Fields("fullname")= Request("fullname")
data.Fields("add1")= Request("add1")
data.Fields("add2")= Request("add2")
data.Fields("email")= Request("email")
data.Fields("cardType")= Request("cardType")
data.Fields("cardNum")= Request("cardNum")
data.Fields("cardExpiryMonth")= Request("cardExpiryMonth")
data.Fields("cardExpiryYear")= Request("cardExpiryYear")
data.Fields("totalPrice")= Request("totalPrice")
data.Update

data.Close()
connection.Close()
%><%
'Dimension variables
Dim conn
Dim check1
Dim data1
Dim insert1
Dim query1
Dim newQuant
Dim oldQuant
Dim one

Set conn = Server.CreateObject("ADODB.Connection")

conn.Open("auction1")

Set data1 = Server.CreateObject("ADODB.RecordSet")

query1 = "SELECT Quant FROM Holidays WHERE Quant = '" &_
Request ( "Quant") & "'"

data1.CursorType=2
data1.LockType=3
data1.Open query1, conn
oldQuant = CStr (Request("Quant"))
newQuant = (insert1 & (oldQuant) - 1)
data1.Fields("Quant")= newQuant
data1.Update

data1.Close()
conn.Close()
Response.Write(newQuant)

%>

my aim is to reduce the quant value in the database by 1!!

 
ya mine problem was a deliminater problem and i solved it and i messed it up again be adding another condition to the where in the sql statment:

query1 = "SELECT Quant, flightID FROM Holidays WHERE Quant = '" _
& Request ( "Quant") & "'" _

& " AND flightID = '"_
& Request ( "fid") & "'"

the same error is back again. to solve it the first time i removed the single quotations and it worked but when i try to do that to the sql statement again i get an error saying that their missing..

does that make sense :>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top