Salesforce ODBC INSERT thru linked server in SSMS

Salesforce ODBC INSERT thru linked server in SSMS

Postby jlgervais » Mon 20 Mar 2017 15:22

- I Created a linked server (SFCxp)
- I Created a test table "TestODBC" it has one user column "Name"

Code: Select all
SELECT * FROM [SFCxp]...[TestODBC__c]
-- Works fine
Code: Select all
UPDATE [SFCxp]...[TestODBC__c]  SET Name = 'Update Test'
-- Works fine

Problem is, when i try to insert a row
Code: Select all
INSERT INTO [SFCxp]...[TestODBC__c]  (Name) VALUES ('TEST')


i get this error message :
OLE DB provider "MSDASQL" for linked server "SFCxp" returned message "[Devart][ODBC][Salesforce]Access violation at address 000000000063AE07 in module 'DevartODBCSalesforce.dll'. Write of address 00000000000000BA".
Msg 7343, Level 16, State 2, Line 4
The OLE DB provider "MSDASQL" for linked server "SFCxp" could not INSERT INTO table "[SFCxp]...[TestODBC__c]".

Inserting thru MSAccess works, with the same DSN

Anyone knows the secret of inserting a row in a salesforce table ?
jlgervais
 
Posts: 3
Joined: Fri 17 Mar 2017 14:20

Re: Salesforce ODBC INSERT thru linked server in SSMS

Postby MaximG » Tue 21 Mar 2017 08:13

Try to insert necessary records using OPENQUERY :

Code: Select all
   INSERT OPENQUERY ([SFCxp], 'SELECT Name FROM TestODBC__c') VALUES ('TEST')
MaximG
Devart Team
 
Posts: 742
Joined: Mon 06 Jul 2015 11:34

Re: Salesforce ODBC INSERT thru linked server in SSMS

Postby jlgervais » Tue 21 Mar 2017 12:21

It worked, i was using *
INSERT OPENQUERY ([SFCxp], 'SELECT * FROM TestODBC__c') VALUES ('TEST')
instead of naming each field when i tried using openquery
INSERT OPENQUERY ([SFCxp], 'SELECT Name FROM TestODBC__c') VALUES ('TEST')
Thanks a lot
jlgervais
 
Posts: 3
Joined: Fri 17 Mar 2017 14:20

Re: Salesforce ODBC INSERT thru linked server in SSMS

Postby MaximG » Tue 21 Mar 2017 14:48

We are glad to see the problem resolved. Please don't hesitate to contact us with questions concerning Devart ODBC Driver for Salesforce usage.
MaximG
Devart Team
 
Posts: 742
Joined: Mon 06 Jul 2015 11:34


Return to ODBC Drivers