-
Hi,
I am new to VB. I am running VB6 sp3 on Win98.
I have a program querying a db.
When constructing a query, I compose it using String fragments like:
Dim SQL As String
...
SQL = SQL & " And PPC.PNO = SPD.PNO "
When I hit 250 char limit, nothing get's appended anymore.
What do I do wrong?
Thanx,
Cristi
-
Limit? Maybe i am being dumb, as i have not had to write any SQL satements in a while, but where is the 250 character limit comming from?
-
You tell me :-(
I just found that after 250 chars nothing gets appended anymore to the string. No matter how many
SQL = SQL & "blah blah"
I add, I can't get past 250 chars limit.
It doesn't have anything to do with SQL, I may try to compose a recipe for strawberrypie this way (appending small amounts of chars at a time) and still cannot pass over 250 chars limit.
-
I don't understand. This is just a sample of code to build a 500 cahracter string in small portions.
It seems to work.
Code:
Private Sub Command4_Click()
Dim SQL As String
Dim ictr As Integer
For ictr = 1 To 100
SQL = SQL & String(5, Chr((200 * Rnd) + 55))
Next ictr
MsgBox SQL
End Sub
-
You're not using a fixed-length string, are you? (From your example it appeared like you were not.)
In other words, this should not give you a problem:
Dim SQL As String
But this would:
Dim SQL As String * 250
With the String * 250, anything you try to append to it after the 250th character would be lost. I can't think of what else might be causing your problem.
-
Maybe the String gets right.
I try to see it in the Watch window.
Where I can see max 250 chars of it.
Which makes me mad because I want to run my query by hand to see exactly what are the results.
Is there any way to get this info out from VB6 SP3? I don't want a message box :-(
-
You mean you want to see the query?
Try
This will print the string held in SQL to the immediate window. Hope this is what you are after.