gamcp
06-30-03, 15:24
| I'm writing a VB application where I'm trying to access a number of DBF files using Jet 4.0. Using the following code I can access the data. Dim objCon As ADODB.Connection Dim objCom As ADODB.Command Dim objRS As ADODB.Recordset Set objCon = New ADODB.Connection Set objCom = New ADODB.Command 'Open connection objCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Extended Properties=dBASE IV;" & _ "Data Source=c:\MDW2;" objCon.Open objCon.ConnectionString 'get record set Set objRS = New ADODB.Recordset 'Run multi select statment objRS.Open "SELECT * From Patients", objCon, adOpenStatic, adLockReadOnly, adCmdText If objRS.RecordCount > 0 Then objRS.MoveLast End If The above code works However if I replace the recordset statement with * with a specific field name eg. surname objRS.Open "SELECT surname From Patients", objCon, adOpenStatic, adLockReadOnly, adCmdText This cause an error No value given for one or more required paramters Does anybody know how to get this working? TIA Grant |