Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append from cursor
Message
From
05/08/2016 14:04:57
 
 
To
05/08/2016 13:02:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01639069
Message ID:
01639155
Views:
62
In this case he wants to append from a cursor into a table on a MSSQL server, and that isn't possible with your approach.

>Tore is correct that a cursor exists only in VFP "memory" and you cannot APPEND from a cursor: however there is a trick to get around that.
>
>Cursors may _look_ like they only exist in memory, but they are on disk in a temporary file. You can use DBF() to get the name of that file and append like this:
>
>
>select 0
>create cursor foo1 (test1 c(10), test2 c(10))
>&& put some records in the cursor
>select 0
>use foo5  
>append from dbf("foo1")
>
>
>>Sir I have these codes
>>
>>
>>create cursor pr_rate (date d(8), code  c(7),desc1 c(100),weight n(8,2),rate1 n(4),rate2 n(4),rate3 n(4))
>>
>>
>>I fill cursor pr_rate with some commands, when cursor has data then I want to insert this cursor into a sqlserver table.
>>For this I use this command
>>
>>
>>	cmd="insert into srate select * from pr_rate order by date"
>>		if sqlexec(con,cmd)<0
>>			aerror(laerror)
>>			messagebox(laerror[1,2])
>>			return.f.
>>		endif
>>
>>
>>
>>But it show this error message
>>
>>Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'pr_rate'.
>>
>>Please help me.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform