Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLExecute and resulting Object
Message
General information
Forum:
ASP.NET
Category:
Visual FoxPro Toolkit for .NET
Miscellaneous
Thread ID:
00659391
Message ID:
00660010
Views:
19
Hi Fred,

Here is a sample that will do the trick.
Imports VFPToolkit.arrays
Imports VFPToolkit.common
Imports VFPToolkit.dates
Imports VFPToolkit.dialogs
Imports VFPToolkit.environment
Imports VFPToolkit.files
Imports VFPToolkit.math
Imports VFPToolkit.strings
Imports VFPToolkit.vfpData
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.Common

Public Class Form1
    Inherits System.Windows.Forms.Form

    Dim goView As DataView

    Private Sub cmdLoadData_Click(ByVal sender As System.Object, _
		 ByVal e As System.EventArgs) Handles cmdLoadData.Click
        'declare the connection string and sql statement
        Dim lcConnectionString As String 
	lcConnectionString = "Provider=vfpoledb.1;Data Source='C:\Program Files\Microsoft _
			 Visual FoxPro 7\Samples\Data\testdata.dbc';password='';user id=''"
        Dim lcSQL As String = "select * from customer"
        Dim oConn As OleDbConnection

        'Connect to the Database, execute the query and disconnect
        'SqlConnect(), SqlExecute(), SqlDisconnect()
        oConn = SqlConnect(lcConnectionString)
        goView = SqlExecute(oConn, lcSQL, "CustomerList")
        SqlDisConnect(oConn)

        'Select the default cursor
        VFPToolkit.vfpData.Select(goView)
        Browse()

    End Sub
End Class
You can use Try-Catch-Finally to track errors.

hth,
Kamal

>>Hi Fred,
>>
>>
>>Dim goView As DataView
>>goView = SqlExecute(oConn, lcSQL, "CustomerList")
>>
>>
>>hth,
>>Kamal
>>
>>>With the stupid questions atleast you know that people are using the toolkit. In the SQLExecute example in the help
>>>
>>>'Connect to the Database, execute the query and disconnect
>>>'SqlConnect(), SqlExecute(), SqlDisconnect()
>>>oConn = SqlConnect(lcConnectionString)
>>>goView = SqlExecute(oConn, lcSQL, "CustomerList")
>>>
>>>goView is the resulting object from the SQLExecute. How should goView be defined? Which object should it be defined as?
>>>
>>>Thanx.
>
>I'm still having some problems. Is there an error object that I can look at to see the exact error?
Previous
Reply
Map
View

Click here to load this message in the networking platform