Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
V.F.P. oledb
Message
De
15/03/2006 15:26:18
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Divers
Thread ID:
01104360
Message ID:
01104680
Vues:
16
As I recall, Fox2x tables don't allow NULL values. However, they do allow "empty" values. Maybe the OLE DB data provider is having trouble with this.

>1. Will MACHINE make a difference if you use it instead of GENERAL in connection string?
>2. Try instead of "Select * from Paidinvs", select numeric fields one at a time. At least you will see what field caused the problem.
>3. Is there NULL allowed in the field? Is there nulls in the field?
>
>
>>Hi Yuri
>>
>>It is a 2.6 for Windows table. I dont think it is any problem with the code as it works on other tables just fine but here it is. I actually have alot of the code in a utilities class but think I broken out the relevent stuff or posted the functions in the class.
>>
>>The problem seems to be with numeric fields in the fox table as this table has quite a few. Is there a way to identify the row that is failing? I am able to succusfully query a single row in the table so i need to be able to look at which row is failing to see if there is something "different" in the data.
>>
>>
>>
>>
>>
>>
>>  Dim LoDataTable As New DataTable
>>  Dim StrConnectionString as String = Utilities.GetConnString("c:\data", Utilities.ConnectionTypes.OLEDB_VFP_FreeTable)
>>  Dim StrQuery as String = "Select * from Paidinvs"
>>  Dim LoConn As New OleDb.OleDbConnection
>>                Dim loDataAdapter As New OleDb.OleDbDataAdapter
>>
>>                Try
>>                    LoConn.ConnectionString = StrConnectionString
>>                    LoConn.Open()
>>
>>                    loDataAdapter = New OleDb.OleDbDataAdapter(StrQuery, LoConn)
>>
>>                    loDataAdapter.Fill(LoDataTable)
>>                Catch ex As Exception
>>                    LoDataTable.Dispose()
>>                    Throw ex
>>                Finally
>>                    loDataAdapter.Dispose()
>>                    LoConn.Close()
>>                End Try
>>
>>Public Class Utilities
>> Enum ConnectionTypes
>>        OLEDB_VFP_FreeTable
>>        OLEDB_VFP_DBC
>>        OLEDB_Access
>>        OLEDB_Excel
>>        SQL_Standard
>>        SQL_Trusted
>>    End Enum
>>
>>    Public Shared Function GetConnString(ByVal DataSource As String, ByVal ConnectType As ConnectionTypes, Optional ByVal SQLDatabase As String = "", Optional ByVal UserId As String = "", Optional ByVal Password As String = "") As String
>>        Try
>>            Select Case ConnectType
>>                Case ConnectionTypes.OLEDB_VFP_FreeTable
>>                    Return "Provider=vfpoledb.1;Data Source=" & DataSource & ";Collating Sequence=general"
>>                Case ConnectionTypes.OLEDB_VFP_DBC
>>                    Return "Provider=vfpoledb.1;Data Source=" & DataSource & ";Collating Sequence=machine"
>>                Case ConnectionTypes.OLEDB_Access
>>                    Return "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataSource & ";User Id=" & UserId & ";Password=" & Password & ";"
>>                Case ConnectionTypes.OLEDB_Excel
>>                    Return "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataSource & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
>>                Case ConnectionTypes.SQL_Standard
>>                    Return "Data Source=" & DataSource & ";Initial Catalog=" & SQLDatabase & ";User Id=" & UserId & ";Password=" & Password & ";"
>>                Case ConnectionTypes.SQL_Trusted
>>                    Return "Data Source=" & DataSource & ";Initial Catalog=" & SQLDatabase & ";Integrated Security=SSPI;"
>>                Case Else
>>                    Throw New Exception("Connection Type Not Recognized")
>>            End Select
>>        Catch ex As Exception
>>            Throw ex
>>        End Try
>>    End Function
>>
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform