CONVERT
Hej,Dette stykke kode virker fint i SQL7, men ikke i SQL6.5:
dim strAction
dim strID
strAction = Request(\"action\")
if strAction = \"edit\" then
strID = Cint(Request(\"id\"))
set oConn = server.CreateObject \"ADODB.Connection\")
Set oRs = server.CreateObject \"ADODB.recordset\")
oConn.open session(\"DSN\")
strSQL = \"SELECT * FROM vip_catalog WHERE id = \" & strID
oRs.Open strSQL, oConn, 1, 3
Jeg får denne fejlmeddelelse:
Microsoft OLE DB Provider for ODBC Drivers error \'80040e07\'
[Microsoft][ODBC SQL Server Driver][SQL Server]Disallowed implicit conversion from datatype \'varchar\' to datatype \'int\' Table: \'flco_public_website.dbo.Vip_catalog\', Column: \'Id\' Use the CONVERT function to run this query.
Hvordan gør jeg?
Michael