Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 7th, 2005, 04:27 AM
Authorized User
Join Date: Jan 2005
Location: ipaja, lagos, Nigeria.
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to p2ptolu Send a message via Yahoo to p2ptolu
Default error message displays

I used an APPEND QUERY in access and upsived to SQL server 7, but i had to host on SQL Server 2000, my append query was not created so i used the codes below to create a stored procedure and it displays an error under the query, please how do i solve this issue.

INSERT INTO AuditUpdate ( TypeId, ElementSectionId, ElementTypeId, ElementId, ElementTitle, UserId, TimeUpdate )
VALUES ([TypeId], [ElementSectionId], [ElementTypeId], [ElementId], [ElementTitle], [UserId], CDate([TimeUpdate]));

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

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ','.

/cms/siteeditors/CmsUserAddEditFn.asp, line 51


    'get form data
    intId = Replace(Request.form("id"), "'", "''")
    intTypeId = Replace(Request.form("TypeId"), "'", "''")
    strUsername = Replace(Request.form("Username"), "'", "''")
    strPassword = Replace(Request.form("Password"), "'", "''")
    strEmailAddress = Replace(Request.form("EmailAddress"), "'", "''")

    'validate form data
    if not Isnumeric(intId) then intId = 0 'set id to impossible id no so recordset returns eof
    if not IsNumeric(intTypeId) or strUsername = "" or (intId = 0 and strPassword = "") then
        session("msg") = "Error! <i>Invalid or missing data."
        response.Redirect "../main/msg.asp"
    end if

    'open data sources
    Set oConn = Server.CreateObject("ADODB.Connection")
    'oConn.open = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("..\..\db\db.mdb")
    oConn.Open application("dbaseConn")
    Set oRset = Server.CreateObject("ADODB.Recordset")
    strSql = "SELECT * FROM Editors WHERE Id = " & intId
    oRset.Open strSql, oConn, adOpenStatic, adLockOptimistic

    'add/edit data
    strUpdateType = "edited"
    intUpdateType = 2
    if oRset.eof then
        strUpdateType = "added"
        intUpdateType = 1
    end if

    oRset("TypeId") = intTypeId
    oRset("UserName") = strUsername
    if not ((intUpdateType = 2) and (strPassword = "")) then oRset("Password") = strPassword
    oRset("EmailAddress") = strEmailAddress


    'get Id of new or added item
    intId = oRset("id")

    '-----update audit records - TypeId, ElementTypeId, ElementId, ElementTitle, EditorId, TimeUpdate
    strSql = "qryAuditUpdateAdd" & intUpdateType & ", 1, "& intId & ", '" & strUsername & "'," & CInt (session("UserId")) & ", " & CDbl(Now)
    oConn.Execute strSql

    'close data sources
    set oRset=nothing
    set oConn=nothing

    'display results
    session("msg") = "Success! <i>CMS User " & strUpdateType & ".</i>"
    session("submenu") = "cmsuser"
    response.Redirect "../main/msg.asp"

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the error message for a 500 server error? chobo2 C# 2005 1 May 4th, 2008 03:11 AM
IE7 displays a blank page... thomasdrago XML 1 January 23rd, 2008 10:01 PM
Report Displays Only One Record dlandolin Access 1 June 6th, 2007 12:18 PM
Crystal Report displays wrong value. shilpa_net2004 VB Databases Basics 2 December 31st, 2005 12:09 PM
Webservice displays only 1 instead of ALL results eli2003 .NET Web Services 0 September 9th, 2003 12:33 PM

All times are GMT -4. The time now is 05:00 PM.

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