Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trouble with standalone dbfs and vb.net
Message
De
13/10/2005 21:44:20
 
 
À
13/10/2005 20:13:44
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Divers
Thread ID:
01057946
Message ID:
01058981
Vues:
17
Nice try Sam, but he can't or won't use the VFPOleDb Provider.

~~Bonnie


>You are using Jet provider, try this one:
>
>        Dim oconn As New System.Data.OleDb.OleDbConnection
>        oconn.ConnectionString = "Provider=VFPOLEDB;Data Source=c:\"
>        oconn.Open()
>        Dim ocmd As New System.Data.OleDb.OleDbCommand
>        oCmd.Connection = oConn
>        ocmd.CommandText = "Create Table test.dbf (filename v(240) Unique, Date v(50) Null)"
>        oCmd.CommandType = CommandType.Text
>        oCmd.ExecuteNonQuery()
>
>
>Thanks
>-Sam.
>>I have to convert a foxpro app to vb.net and Im having trouble with dbfs and this line in general:
>>
>>Create Table "test.dbf" (filename v(240) Unique, Date v(50) Null)
>>
>>
>>The test.dbf is not part of a dbc. So far I have converted it to this:
>>
>>Dim myConn As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\;Extended Properties=dBASE IV;User ID=;Password=")
>>
>>Dim myCmd As New System.Data.OleDb.OleDbCommand("CREATE TABLE test.dbf (filename varchar(240) Unique, Date varchar(50) Null)", myConn)
>>
>>myConn.Open()
>>myCmd.ExecuteNonQuery()
>>
>>
>>It gives me the error "Syntax error in field definition". What is the correct syntax? Also, the unique field obviously speeds up scans alot because of the cdx index, but will vb.net automatically create this index? I need to use a table that wont require a driver that does not come with a clean install of win2k, so I figured a dbf would be the fastest.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform