Hi guys,
I'm not sure if this has been covered or not, but I was wonding how I can execute a query in one database from an external database? Can this even be done? I think I would use ADODB.Command but am not sure. Can anyone help?
I set up a function that uses the execute method of the connection object after establishing the connection to the remote database. I pass the function a SQL string. For example:
I don't think you can execute a saved query on a remote database using ADO. If someone knows how, I would love to hear it too.
sql="UPDATE COMPFILE SET
sql=sql+" COMPFILE.COMP_REPORT_NAME = 'Daily Report for 1/31/03';"
call TablesSql(sql)
Sub TablesSql(ByVal sqlstr As String)
On Error GoTo err_TablesSql
TablesDb.BeginTrans
TablesDb.Execute sqlstr, , adCmdText Or adExecuteNoRecords
TablesDb.CommitTrans 'begin/com trans to flush data to disk
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.