SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP not writing to database

    ive got this script that writes to a db, which seems easy enough, and so it should. but its not working!! and i do not have a clue why not!!

    heres the code
    Code:
    objDBCon.Execute("INSERT INTO tblsSession (sessionStarted) VALUES ('" & dateT & "')")
    and its not working! ive been racking my brain all morning!!

    its connecting to the db thru a dsn connection
    Last edited by dhtmlgod; Oct 2, 2001 at 03:11.

  2. #2
    SitePoint Enthusiast hendo's Avatar
    Join Date
    Jun 2001
    Location
    Australia
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Deep Breaths, mate!

    Calm blue ocean.....calm blue ocean.

    OK...try this then:

    Dim strSQL
    strSQL = "INSERT INTO tblsSession (sessionStarted) VALUES ('" & dateT & "')"
    objDBCon.Execute(strSQL)

    It just seems your string concatenation is not quite OK for where you're putting the string.

    Also, check that you've set the DSN in the connection's properties.

    Hope that helps!

    hendo
    Steve 'Hendo' Henderson
    EnVivo!CS: Fast and Affordable Web Content Management for ASP. 100% Script, No DLLs.
    www.netsystemsco.com

  3. #3
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope, that doesnt work, i dont have control of the dsn, but the host guy i talked to says its been setup fine...

  4. #4
    I have an opinion...
    Join Date
    Sep 2001
    Location
    Barrie, Ontario
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    D - What is the actual error, homer?
    Egotist: A person more interested in himself than in me.
    KodeKrash - Eidix - Barrie LUG

  5. #5
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there is not error when i write to the db, it swhen i try to take the info out
    Code:
    ADODB.Field error '800a0bcd' 
    
    Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. 
    
    /checkOut4.asp, line 10

  6. #6
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,267
    Mentioned
    116 Post(s)
    Tagged
    1 Thread(s)
    This sounds more like an error on a select. I've NEVER seen this on an insert before. You sure you're looking at the right line (have to ask because I've done it before....)
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  7. #7
    I have an opinion...
    Join Date
    Sep 2001
    Location
    Barrie, Ontario
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    D -

    Code:
    Set Rec = Con.Execute( "SELECT .... FROM ... WHERE ...." )
    If Rec.EOF Then strReply = "no record"
    If Not Rec.EOF Then
       While Not Rec.EOF .... Wend
    End If
    Rec.Close : Set Rec = Nothing
    This will keep you from getting that error.
    Egotist: A person more interested in himself than in me.
    KodeKrash - Eidix - Barrie LUG

  8. #8
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    D's away for the weekend (proposing to mrs_d) so I'll make sure he sees this when he gets back
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  9. #9
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the code works locally ok, kode, i know i should have that, but i HAVE to get this infomation out the database and email


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •