If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Accessing DBF files with Jet 4

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-30-03, 15:39
gamcp gamcp is offline
Registered User
 
Join Date: Jun 2003
Posts: 2
Accessing DBF files with Jet 4

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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On