Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 21st, 2004, 10:55 AM
Authorized User
 
Join Date: May 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
%>


 
Old May 21st, 2004, 12:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

In the insert line, the last parameters: '" & strLink & "''" & strDescription & "' is missing a comma:

'" & strLink & "', '" & strDescription & "'

Brian
 
Old May 21st, 2004, 01:31 PM
Authorized User
 
Join Date: May 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

how could i add delete and update buttons, also how would i get to uploading images

 
Old May 21st, 2004, 03:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

You really have to look into a "navigation scheme" of sorts. You could have delete and update links that redirect with querystring values provided, and then test for these conditions as such:
Code:
<%
if ( Request.QueryString("delete") <> "" ) then
  .. do something ..
elseif ( Request.QueryString("update") <> "" ) then
  .. do something ..
elseif ( Request.QueryString("insert") <> "" ) then
  .. do something ..
else
  .. do something ..
end if
%>
Or you can use the buttons to perform some action in an if routine, and when done, it reloads the page:
Code:
<%
if ( Request.QueryString("delete") <> "" ) then
  .. do something ..
end if

if ( Request.QueryString("update") <> "" ) then
  .. do something ..
end if

if ( Request.QueryString("insert") <> "" ) then
  .. do something ..
end if
%>

Load page content here
There are other ways. It depends on how you want to structure your page. For uploading, you can use <input type="file"> for a file upload box.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
asp variables + flash Adam H-W Flash (all versions) 0 July 16th, 2007 11:47 AM
probs while run flash in Access anukagni Access 2 May 17th, 2006 12:43 AM
Flash at ASP.NET jessiang General .NET 2 January 16th, 2006 06:12 AM
flash Vs access database ashishkummar Flash (all versions) 1 October 12th, 2005 09:00 PM
ASP with Flash ells228 Classic ASP Basics 1 August 6th, 2003 02:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.