Results 1 to 7 of 7

Thread: creating a table in a database?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    creating a table in a database?

    Ok, I want to create a table in a database but I'm having one big problem. I don't want to do this through SQL. I'm a little familiar with the ADO control since I'm taking a VB class this semester. I plan to loop through a filelistbox obtaining information about the file and storing the different pieces of info as string variables. I will then add records to my created table based on the strings. The problem I'm having is that if one of the stored strings contains a ' then an error occurs. How can I get around this? Any help appreciated.

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Why don't you want to use SQL? SQL = Magic.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    Fanatic Member
    Join Date
    Sep 2000
    Location
    Over There
    Posts
    522
    could you give me an example of the code you are using?
    I'm sure there's a way around it.

  4. #4
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    Re: creating a table in a database?

    Originally posted by hipopony66
    Ok, I want to create a table in a database but I'm having one big problem. I don't want to do this through SQL. I'm a little familiar with the ADO control since I'm taking a VB class this semester. I plan to loop through a filelistbox obtaining information about the file and storing the different pieces of info as string variables. I will then add records to my created table based on the strings. The problem I'm having is that if one of the stored strings contains a ' then an error occurs. How can I get around this? Any help appreciated.
    Do this:

    VB Code:
    1. Replace(strYoureUsing, "'", "\\'")
    My evil laugh has a squeak in it.

    kristopherwilson.com

  5. #5
    Fanatic Member
    Join Date
    Sep 2000
    Location
    Over There
    Posts
    522
    that works??
    I never knew that

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    \ is the escape character. If he's having a problem with ', it probably needs to be escaped. Although since I don't know what he's doing, I can't be certain that it will help.

    Edits in bold.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7
    Fanatic Member
    Join Date
    Sep 2000
    Location
    Over There
    Posts
    522
    Woo HOO I'm a lively member now.

    Hey Hobo, are you really a HOBO??

Posting Permissions

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



Click Here to Expand Forum to Full Width