arun_rote
05-21-02, 02:27
| I have a .dbf file,i want to access that file using Visual Basic 6.0.How to do this in vb can someone give a example for this. |
View Full Version : Accessing dBase database in Visual Basic
| I have a .dbf file,i want to access that file using Visual Basic 6.0.How to do this in vb can someone give a example for this. |
| [QUOTE=SCIROCCO]Dim cn as ADODB.Connection Dim rs as ADODB.Recordset Set cn = new ADODB.Connection cn.ConnectionString = "Driver={Microsoft dBASE Driver (*.dbf)};" & _ "DriverID=277;" & _ "Dbq=c:\somepath" cn.open set rs = new ADODB.recordset rs.ActiveConnection = cn 'Then specify the filename in the SQL statement: rs.Open "Select * From user.dbf", oConn, , ,adCmdText rs.Close cn.Close Set rs=Nothing Set cn = Nothing i tried this code but it gives me an error of 3001: "arguments are of the wrong type, are out of acceptable range, or are in conflict with one another"... i hope anyone could help me....tnx |