Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| 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
Reply
 
Thread Tools Search this Thread Display Modes
  #41 (permalink)  
Old February 26th, 2007, 05:23 PM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to bonkbc Send a message via Yahoo to bonkbc
Default

Well, I successfully got it working to a degree. But, now there's another issue. I successfully added 1 item to the database. When I went to add another item, I got an error telling me that this update was not allowed because it would create a duplicate record. I thought this was strange, because I had added an item already. I printed out the database to screen and noticed that the new item had ID# "0". Instead of the highest number + 1. I think that each time I go to make an update to the DB, it tries to add another 0 to listnum column and it sees it as a duplicate.

Do you know of an easy way around this problem?

Reply With Quote
  #42 (permalink)  
Old February 26th, 2007, 05:45 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

In Access set the column seed to 1

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
Reply With Quote
  #43 (permalink)  
Old May 24th, 2007, 09:24 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to bonkbc Send a message via Yahoo to bonkbc
Default

Hello,

I'm getting an error that reads something like syntax error in "insert into" statement. I don't see anything glaringly wrong, do you??? : )

here is the code snippet in question:

    <%
    dim newtext
    newtext = request.Form("textspot")
    dim strSQL2

    strSQL2 = "INSERT INTO texteditor (text)" &_
             "VALUES ('" & newtext & "')"

    objconn.Execute strSQL2

    if objconn.Errors.Count = 0 then
        Response.Redirect "success.asp"
    else
        Response.Redirect "fail.asp"
    end if


    objconn.Close
    set objconn = nothing
%>

I'm also getting intermittent errors that state "Unspecified error"
dbconn.INC, line 7

which is my database connection include file. It's strange because sometimes the code is functional and works...but other times I get the unspecified error.

Any help would be greatly appreciated.

thank you,
brian

Reply With Quote
  #44 (permalink)  
Old May 24th, 2007, 09:32 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

The syntax error is probably be caused by the app trying to insert a string like this:

dim newtext
newtext = "Hello! It's very warm outside"

In this case, your insert fails because of the '' in the newtext string because it causes termination of the SQL string when its executed. Replace ' with '' and that will solve your problem.

The unspecified error I can not help you with.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
Reply


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
parametising sql statements in ASP classic trufla Classic ASP Basics 5 June 18th, 2008 02:38 PM
CASE Statements in T-SQL atcs2152 SQL Server 2000 3 April 28th, 2006 10:53 AM
Sql statements in data adapter Raif ASP.NET 1.0 and 1.1 Basics 1 July 14th, 2004 08:50 AM
SQL Statements marmer Classic ASP Basics 3 November 13th, 2003 01:42 AM
Quoting variables in SQL statements tp194 Classic ASP Databases 1 July 4th, 2003 03:41 AM



All times are GMT -4. The time now is 04:43 PM.


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