General information
Forum:
Microsoft SQL Server
I notice that the code does not specify that the date field could except null values in step 1. When the insert is done in step 4 the date value is not specified.
>When using OPENQUERY with INSERT in SQL 7 statements, I get the following error message:
>
>Server: Msg 7399, Level 16, State 1, Line 1
>OLE DB provider 'MSDASQL' reported an error. The provider did not give any information about the error.
>
>The following steps show how to recreate the situation and error:
>
>1. First create a table on the SQL box in Foxpro.
>create table d:\temp\testdb;
> (id c (7),;
> cdescript c (20),;
> dated d)
>
>2. Then add a linked server to SQL to access this.
>sp_addlinkedserver
> @server = 'VFP DATA',
> @srvproduct = 'MSDASQL',
> @provider = 'MSDASQL',
> @provstr = 'Driver={Microsoft Visual FoxPro Driver};UID=;PWD=;SourceDB=d:\temp\;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;'
>
>3. check the connection is working.
>select * from openquery([VFP DATA], 'SELECT * FROM TestDB')
>
>4. attempt to insert a record into the table.
>insert into openquery([VFP DATA], 'SELECT id, cdescript FROM TestDB')
> (id,cdescript)
> values ('1','hello world')
>
>Executing this step gives the following error.
>
>Server: Msg 7399, Level 16, State 1, Line 1
>OLE DB provider 'MSDASQL' reported an error. The provider did not give any information about the error.
>
>If using UPDATE or DELETE this doesn't occur.
>
>Has anyone managed to work around this?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only