G
Guest
'strTest is built in the following fashion:
strTest = _
""" Insert Into """ & " & " & " strTable " & " & " & """ Values (""" & " & "
& _
"Chr$(34) " & "&" & " rst!fields(0) " & "&" & " Chr$(34) " & "&" & " "", ""
" & "&" &_
"Chr$(34) " & "&" & " rst!fields(1) " & "&" & " Chr$(34) " & "&" & " "", ""
" & "&" &_
" Chr$(34) " & "&" & " rst!fields(2) " & "&" & " Chr$(34) " & "&" & " "")"" "
msgbox strTest 'correctly produces the following string:
"Insert Into " & strTable & " Values (" &
Chr$(34) & rst!fields(0) & Chr$(34) & ", " &
Chr$(34) & rst!fields(1) & Chr$(34) & ", " &
Chr$(34) & rst!fields(2) & Chr$(34) & ")"
'Given rst and strTable = "myTable",
' is there a way to resolve the string into an executable sql statment like
the
' following?
Insert Into myTable Values ("xyz", "1a2b3c", "123")
Thanks for your help
strTest = _
""" Insert Into """ & " & " & " strTable " & " & " & """ Values (""" & " & "
& _
"Chr$(34) " & "&" & " rst!fields(0) " & "&" & " Chr$(34) " & "&" & " "", ""
" & "&" &_
"Chr$(34) " & "&" & " rst!fields(1) " & "&" & " Chr$(34) " & "&" & " "", ""
" & "&" &_
" Chr$(34) " & "&" & " rst!fields(2) " & "&" & " Chr$(34) " & "&" & " "")"" "
msgbox strTest 'correctly produces the following string:
"Insert Into " & strTable & " Values (" &
Chr$(34) & rst!fields(0) & Chr$(34) & ", " &
Chr$(34) & rst!fields(1) & Chr$(34) & ", " &
Chr$(34) & rst!fields(2) & Chr$(34) & ")"
'Given rst and strTable = "myTable",
' is there a way to resolve the string into an executable sql statment like
the
' following?
Insert Into myTable Values ("xyz", "1a2b3c", "123")
Thanks for your help