Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just a guess: maybe you have a single quote in your query that has
accidentally got outside of some double quotes; so the string from that point onward is treated as a comment. Something like: SQL = "Select * from myTable where name="' & strName & "' and [... etc] (with name="' << double quote then single ; should be .. name='" << single quote then double) This would be fairly obvious as the comment part would appear as green. If that doesn't help, I think you need to post your code. Andrew Sajit wrote: I have an SQL string in a Excel VBA code equated to a string variable. The SQL is to import data from a group of SQL Server tables. The string is fairly long. While trying to continue to the next line about 8 0r 10 times, VBA gives me an error saying that I have exceeded the number of permitted continuations allowed. I therefore broke the string into 2 and assigned it to 2 variables and then concated the 2. However when I check string1, I notice that it did not contain all of the right hand side of the equation. (string1 = "select * from ....). string = string1 & string2. There does not seem to be any syntax error with the string. That is, with the & and continuation _. I see in the VBA help that the allowed lengths are as, A variable-length string can contain up to approximately 2 billion (2^31) characters. A fixed-length string can contain 1 to approximately 64K (2^16) characters. The strings are not that long. Wonder what is the limitation that cut shorts the length of the string. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change 3 letter text string to a number string | Excel Discussion (Misc queries) | |||
Replace Hyperlink Addresses Help 'Dim OldStr As String, NewStr As String | Excel Programming | |||
Importing Long String - String Manipulation (INVRPT) (EDI EANCOM 96a) | Excel Programming | |||
to search for a string and affect data if it finds the string? | Excel Worksheet Functions | |||
Create a formula into a String then assign string to a cell | Excel Programming |