Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database not handling comma ","

Status
Not open for further replies.

WyoProgrammer

Technical User
May 13, 2005
25
US
I have written a program that is basically a simple database to manage data pertaining to a coin collection. I am able to use the program but offered it as a shareware program and I am having people experience 'Type Mismatch' errors. I think it is that these users are entering commas in the fields and when the data is stored, the comma is interpreted as another field and everything gets thrown off. Other than limiting all fields so the comma is culled out, how can I handle this problem. I am not an expert programmer, being completely self-taught and this is an issue I just have not been able to resolve properly.
 
If you are putting it into some SQL of some sort, enclose the text with '
 
As I said before, this is a simple database. The data is stored by using 'Open #1 As Output/Print' and retrieved by using 'Open #1 As Input/Input'. Does the ',' work in this environment as well?
 
Try using the Write instead of Print.

Dim A$
Open #1 As Output

A$="12345 Address, Anytown USA"
Write #1 A$

Close

A$=""
Open #1 As Input
Line Input #1, A$
 
Thanks waytech2003 & xwb! That was my problem all along, I was using the wrong storing format! How can something so simple be so difficult sometimes? Guess that's what one gets when they try to teach themselves anything. At any rate, I thank you and I have learned a huge lesson today that I can use in a couple other programs that have been giving me intermittent problems. I know not to enter commas so my programs don't give me problems but when others use them, this is not the case and this problem pops up occasionally. I did notice that when I use 'Print #1....' it store the data without quotes " " but when I use 'Write #1....' it utilizes the quotes and the commas are not a problem. You two have made my day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top