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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB^ + MS Word Mail Merge

Status
Not open for further replies.

rennis

Programmer
Joined
Dec 6, 2006
Messages
80
Location
CA
Has anyone ever come across the following error when trying to complete a mail merge in ms word, using data from vb6?

"String is Longer then 255 characters"

It occurs on the .opendatasource line with the Select statement.
Select * from table where primary_key in ("& the_primary_key_var &")

In this instance the_primary_key_var represents all primary keys selected separated by a comma (1,2,3,4,5,6) etc.

Any help is appreciated
 
rennis,

Not sure if I'm reading this right, but is that the exact SQL statement?

Select * from table where primary_key in ("& the_primary_key_var &")
If you are putting the sql into a string I would expect to see:
sSQL="Select * from table where primary_key in (" & the_primary_key_var & ")"

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top