If I have understood correctly you want to insert into a table in your Access mdb file from your VB6 program, but you can't do so directly. You already have the Access database Survey2014.mdb set up as linked server 'SurveyBMB' in MSSQL.
INSERT INTO SurveyBMB.Survey
SELECT *
FROM OPENDATASOURCE(
'Microsoft.Jet.OLEDB.4.0',
'Data Source="C:\SURVEYTRACKING\Survey2014.mdb"')...Survey
WHERE Survey.VESSEL = 'ABC 24/14' and Survey.[Date Arrival] = '11/7/2014'
ORDER BY Survey.Item
sp_configure 'show advanced options',1
GO
reconfigure with override
GO
sp_configure 'Ad Hoc Distributed Queries',1
GO
reconfigure with override
GO
And the run the SELECT again.
I press on New Querry and pasted your lineYou need to execute all my script since the first part is to put in advanced option so you can check the value in the 2nd part. Since you already know that's zero then you need to set it to 1:
sp_configure 'Ad Hoc Distributed Queries'
Which showed 'Ad Hoc Distributed Queries' in Red and pressed Execute button and got following result:
Msg 15123, Level 16, State 1, Procedure sp_configure, Line 62
The configuration option 'Ad Hoc Distributed Queries' does not exist, or it may be an advanced option.
sp_configure 'show advanced options',1
GO
reconfigure with override
GO
sp_configure 'Ad Hoc Distributed Queries',1
GO
reconfigure with override
GO
Now you can execute the SELECT part as check if it works.
Since your vb6 application is transferring data from linked server to linked server*, I would test these two pieces of the puzzle separately: first ensure that SELECT selects, then that INSERT inserts, and only then combine them together - all that from within your vb6 application.
That said, i wonder, if you need to transfer the data from one Access database to another Access database, wouldn't it be easier to do it directly, without involving sql server? you could use linked tables in Access mdb file, or you could do it programmatically (I guess, 10-15 lines of code, hardly more) in VB6/ADO or vb.net.
*) which is what I would do. Currently you have configured one mdb as linked server, but another you are trying to use by name. Why not to link it as linked server as well? The query would be
Once you have it working in ssms, the next step is do it from vb6. Use the same connection string in vb6 as you do for any regular sql server query, such as:
Maybe I don't see the full picture, but I don't understand why you need to change anything at all. That fact that now surveybmb.mdb is also accessed by their application through sql server does not mean that you can't do anymore what you have been doing all the time, i.e "I was using successfully insert into survey in "c:\surveybmb.mdb" select * from survey "c:\server2014.mdb"
Dim cn As New ADODB.Connection, rs As New Recordset, rs2 As New Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db.mdb"
rs.CursorLocation = adUseClient
rs.Open "select * from table1", cn
Set rs.ActiveConnection = Nothing
cn.Close
cn.Open "Provider=SQLOLEDB;Integrated Security=SSPI;Initial Catalog=db;Data Source=(local)"
I have to say that I've never personally created a linked server to an MSAccess database, but the syntax to address a linked server is 4 part notation (LinkedServer.Database.Sch
SurveyBMB...Survey
Regarding the connection string, you would be connecting to the MSSQL server, so there wouldn't be another separate connection string.