Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Updating records in ASP with Execute command


  • Please log in to reply

#1
Immortalarena

Immortalarena

    Member

  • Member
  • PipPipPip
  • 211 posts
If I want to delete multiple records it works fine, but I tried to update multiple records and I think I have something wrong with my code. It is updating the records, but it is just putting numbers in instead of the information I want.

I should have Values True and 01/15/2011
but I get -1 and 31510028178352E

I know the problem is Here:

adoCon.execute("update library SET flagged = "&truth&" where book_ID ="&sflag&";")
	adoCon.execute("update library SET expiration = "&expireing&" where book_ID ="&sflag&";")

expireing and Truth are both passed from a form on the previous page. The full code will update multiple records at a time, but right now it is inserting the wrong information... or it is inserting it the wrong way. The fields are text fields in the database.

It is most likely an obvious fix, but I don't see what I am missing. Any help would be appreciated. Thanks,

Matt :)
  • 0

Advertisements


#2
Immortalarena

Immortalarena

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 211 posts
Answered my own question. I needed to add a single quotation on the outside of the double quotation as below.

adoCon.execute("update library SET flagged = '"&truth&"' where book_ID ="&sflag&";")
	adoCon.execute("update library SET expiration = '"&expireing&"' where book_ID ="&sflag&";")

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP