Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I execute stored procedure in SQL-server
Message
From
26/11/2004 10:12:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP3
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00963459
Message ID:
00964916
Views:
8
>Hi Cetin,
>
>I have used the cursor adaptor to execute the stored procedure. This works fine when no pararameters are expected by the stored procedure. How do I specify the parameters for the cursor adaptor. Here is example of my code.
>
>** create connecttion to database
>
>oRecordSet.cursortype = 3
>oRecordSet.LockType = 2
>WITH loCursor
> .ALIAS = 'mytab'
> .DATASOURCETYPE = 'ADO'
> .DATASOURCE = oRecordSet
> .SELECTCMD = 'select_mytab_1'
> .DATASOURCE.ACTIVECONNECTION = loConn
> loCommand.ActiveConnection = loConn
> IF .CURSORFILL (.F., .F., 0, loCommand)
> BROWSE
> ELSE
> AERROR(laErrors)
> MESSAGEBOX(laErrors[2])
> ENDIF
> loCommand.ActiveConnection = loConn
>ENDWITH
>
>Also, if i want to assign the returned data to textboxes and combos etc, how do I do that?

"Also, if i want to assign the returned data to textboxes and combos etc, how do I do that?"
With cursor adapter it's as if it was a native VFP table for you. As I see you aliased it 'mytab'.
You use mytab.fieldname as controlsource. IOW if you can natively browse it rest is how you would do with a native table.

Check:
Thread #906520
Thread #944961 - here especially pay attention to Aleksey's messages.

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform