RSS Forums RSS
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums

reading records from a .dbf file

Join Date: Jul 2007
Posts: 71
Reputation: suneel kar is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
suneel kar suneel kar is offline Offline
Junior Poster in Training

Re: reading records from a .dbf file

  #26  
Jul 26th, 2007
hello veena
i am sendin u the code see wts problem in this.
it is givvin "unrecognized database format" error.
reply plzz.
code is
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset

Private Sub Command1_Click()
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\RR.dbf ; Persist Security Info=False"
rs.Open RR, con, adOpenForwardOnly, adLockOptimistic
Dim str As String
If Dir("c:\Suneel_Development\New Folder\New Folder\data.txt") <> "" Then
Kill "c:\Suneel_Development\New Folder\New Folder\data.txt"
End If
Open "c:\Suneel_Development\New Folder\New Folder\DATA.TXT" For Append As #1
Do While rs.EOF = False
For i = 0 To rs.Fields.Count - 1
If i < rs.Fields.Count - 1 Then
str = str & IIf(IsNull(rs(i)), "null", rs(i)) & Chr(9)
Else
str = str & IIf(IsNull(rs(i)), "null", rs(i))
End If
Next
Print #1, str
rs.MoveNext
str = ""
Loop
Close #1
rs.Close
con.Close
End Sub
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:55 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC