mikeyanagita
New member
- Local time
- Today, 00:35
- Joined
- Nov 3, 2010
- Messages
- 3
ADO Execute SQL string length (SOLVED)
I'm trying to send values from an excel workbook to an Access database using VBA. Problem is that sometimes strLongString gets really long, and apparently the Execute command can't use any SQL string longer than ~306 characters, so the SQL statement gets truncated and doesn't make any sense.
NB that field1 is a memo field, so that shouldn't be the problem. The problem is the SQL statement getting cut short.
Any workaround? Can I make Execute method accept longer strings? Or any way to send these values to Access without using an SQL string?
Thanks in advance.
I'm trying to send values from an excel workbook to an Access database using VBA. Problem is that sometimes strLongString gets really long, and apparently the Execute command can't use any SQL string longer than ~306 characters, so the SQL statement gets truncated and doesn't make any sense.
NB that field1 is a memo field, so that shouldn't be the problem. The problem is the SQL statement getting cut short.
Any workaround? Can I make Execute method accept longer strings? Or any way to send these values to Access without using an SQL string?
Thanks in advance.
Code:
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathToMDBFile)
conn.Open
'...
'...
'...
'now the SQL statement where I send data to the db
conn.Execute "UPDATE [tbl_EIQ_Point_Information] " & _
"SET [field1] = '" & strLongString & "' " & _
"WHERE [field2] = '" & strField2Value & "' AND [field3] = '" & strField3Value & "'"
Last edited: