asp flash access
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same.
i dont see the problem the only field not included is the key,heres the code can anyone help
<%@LANGUAGE="VBScript" %>
<%
Option Explicit
'Turn buffering on
Response.buffer=True
'Make the page expire immediately so that it doesn't stay in the accessing computer's cache when called again
response.Expires=-1500
%>
<%
'Start Declaring all variable used by you (you can do this as you code)
Dim DBConn, strDB, strInsertSQL, strName,strResult,strMovie,strLink,strDescription
'Give the Database Connection String
strDB = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("AddressBook.mdb") & ";DefaultDir=" & Server.MapPath(".") & ";DriverId=25;FIL=MS Access;MaxBufferSize=512;PageTimeout=5"
'Get today's Date and the data sent from Flash (Replace is used to replace a ' with '' (2 quotes together) because a database doesn't allow insertion of strings with a single ' )
strName=Replace(request("Name"),"'", "''")
strResult=Replace(request("Result"), "'", "''")
strMovie=Replace(request("Movie"), "'", "''")
strLink=Replace(request("Link"),"'", "''")
strDescription=Replace(request("Description"), "'", "''")
'Give the SQL Insert Statement
strInsertSQL="Insert Into pk_database (Name,Result,Movie,Link,Description)Values ('" & strName & "','" & strResult & "',' " & strMovie & "','" & strLink & "''" & strDescription & "' )"
'Open the database and insert the data
if strName<>"" and strResult<>"" and strMovie<>"" and strLink<>"" and strDescription<>"" then
Set DBConn = Server.CreateObject("ADODB.Connection")
DBConn.Open strDB
DBConn.execute strInsertSQL
response.write "iSuccess=1" 'Send a success response to Flash
Else
response.write "iFailed=1" 'Send a failed response coz' the name or/and email field was null.
End If
'Close the database connection
DBConn.close
Set DBConn=Nothing
%>
|