Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EXACT setting in VFPOLEDB
Message
From
02/03/2004 21:28:20
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
02/03/2004 12:05:29
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00882377
Message ID:
00882579
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
>I'm trying to execute a SELECT statement using the VFPOLEDB provider from .Net, but unfortunately it acts as if EXACT is set to on, I've tried issuing a Command of "SET EXACT OFF" after opening the connection, but the SELECT always obtains the exact matches.

Hi Kev,

The following VB code works for me:
Imports System
Imports System.data
Imports System.Data.OleDb

Module Module1

    Sub Main()

        Dim cConnString As String = "User ID=;DSN=;" & _
            "Cache Authentication=False;Data Source=""C:\MY DOCUMENTS\VISUAL FOXPRO PROJECTS\TestSettings.dbc"";" & _
            "Password=;Provider=""VFPOLEDB.1"";Collating Sequence=MACHINE;MaskPassword=False;Mode=Share Deny None;" & _
            "Extended Properties=;Encrypt Password=False;"

        Dim oConnection As System.Data.OleDb.OleDbConnection = New OleDbConnection(cConnString)
        Dim oCommand As OleDbCommand = New OleDbCommand

        Try

            oCommand.Connection = oConnection
            oConnection.Open()

            oCommand.CommandText = "SET EXACT OFF"
            oCommand.ExecuteNonQuery()
            oCommand.CommandText = "SET ANSI OFF"
            oCommand.ExecuteNonQuery()

            ' Gets Apples and Applesauce
            oCommand.CommandText = "SELECT * FROM TestSettings WHERE Field1 = 'Apples'"

            Dim oDataReader As System.Data.OleDb.OleDbDataReader = oCommand.ExecuteReader()

            Do While oDataReader.Read
                System.Console.WriteLine(oDataReader.GetValue(0).ToString)
            Loop

        Catch oEx As Exception

            MsgBox(oEx.ToString)

        Finally

            oConnection.Close()

        End Try


    End Sub

End Module
Previous
Reply
Map
View

Click here to load this message in the networking platform