Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: strings and integers UGGGGG


Message #1 by "Daniel O'Dorisio" <dodorisio@h...> on Wed, 27 Jun 2001 14:14:33 -0400
i was doing an insert.. and it didnt let me.. but this is interesting.. i am
gonna go back and play with it some more..
yeah you are right about the sql string is a string.. i must have had
invalad chars in the string before hand..

thanks

daniel

-----Original Message-----
From: Kim, Cardyin [mailto:CKim@s...]
Sent: Friday, June 29, 2001 1:48 PM
To: professional vb
Subject: [pro_vb] RE: strings and integers UGGGGG


Dan,

In the following case, MyTable has a numeric field
called MYID.  If you are executing the following statments:

Dim MyVariable as String
conMain.Execute "SELECT * FROM MyTable WHERE MYID = " & MyVariable

the whole string of
"SELECT * FROM MyTable WHERE MYID = " & MyVariable
gets evaluated into a string before it is sent to
the SQL server.

No matter what type MyVariable is, it will be converted
to a string.  When you sent this:

 ,'" & ifcode & ifax & "', '" & iacode & iphone & "',

I presumed you were doing something of that sort.
In this case, the whole thing becomes a string.

Also, not that there is an example of this in
the real world, but if you had a phone number
that started with 0 then iacode & iphone
will only give you 9 digits.

Cardyin

--------------------------------------
Cardyin Kim
C/S & Web Development Analyst
Information Services
San Antonio Community Hospital
ckim@s...     (xxx)xxx-xxxx
--------------------------------------




  Return to Index