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.
Re: creating a table in a database?
Quote:
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, "'", "\\'")