|
-
Nov 14th, 2002, 10:53 PM
#1
Thread Starter
Fanatic Member
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.
-
Nov 14th, 2002, 11:17 PM
#2
Stuck in the 80s
Why don't you want to use SQL? SQL = Magic.
-
Nov 14th, 2002, 11:26 PM
#3
Fanatic Member
could you give me an example of the code you are using?
I'm sure there's a way around it.
-
Nov 14th, 2002, 11:29 PM
#4
Stuck in the 80s
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:
Replace(strYoureUsing, "'", "\\'")
-
Nov 14th, 2002, 11:31 PM
#5
Fanatic Member
that works??
I never knew that
-
Nov 14th, 2002, 11:34 PM
#6
Stuck in the 80s
\ 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.
-
Nov 14th, 2002, 11:36 PM
#7
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|