Wondering how to execute an SQL procedure from a VB form. For example I have a text file name "something.sql". How would I execute this script command from VB to dump data into my database.
I am not aware of a method to run a script file within Visual Basic, but there might be one. Instead you can create a string variable set to the sql statement and then execute it either from your connection or command object. The example below is for a command object.
Dim objCommand as ADODB.Command
Dim strSQL as String
Set objCommand = New ADODB.Command
strSQL = "YourSQLStatement"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.