User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 426,470 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,272 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 9598 | Replies: 64 | Solved
Reply
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

  #11  
Jul 23rd, 2007
hi veena .
con.open statement worked.
"rs.Open Text1.Text, con, adOpenForwardOnly, adLockOptimistic"
what it does actually.reply
regards
suneel





Originally Posted by QVeen72 View Post
Hi Suneel,

if u r using ADO, then open Connection like this:

con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & ";Extended Properties=DBase IV"

u have to give Extended properties in connection string, and when it comes to .dbf or older Foxpro Versions of data, they dont have a single DB, u have to mention Folder path name.


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

  #12  
Jul 23rd, 2007
hi veena
is it possible that text1.txt can contain CHECK_2045.pdf.
can i give the name of folder directly where CHECK_2045 is present.
CHECK_2045 is present in C:\Suneel_development\New Folder\record reading\CHECK_2045.pdf
may i write like this
"rs.Open CHECK_2045.pdf, con, adOpenForwardOnly, adLockOptimistic
it is giving object required error.
wt to do here
regards
suneel
Originally Posted by QVeen72 View Post
Hi Suneel,

What does ur Text1.Text contain...?
It shoud have either Table name (CHECK_2045) or a Select Query Statment (Select * From CHECK_2045)


Regards
Veena
Reply With Quote  
Join Date: Nov 2006
Posts: 712
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 97
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

Re: reading records from a .dbf file

  #13  
Jul 23rd, 2007
hi Suneel,

In the above Program, con is the Connection Object which allows u to connect to the Database. Since Database has many sets of tables, u will have to use RecordSet object to access data.

check this :
rs.Open "Select * from MyTable", con, adOpenForwardOnly, adLockOptimistic

here RS is the Recordset object which actuualy holds Table Data, this is opened thru Con object.
CHECK_2005 should be .dbf File and Is actually the Table and u r opening it thru recordset.

u cannot open PDF files with ADO in VB6


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

  #14  
Jul 23rd, 2007
hi veena
we cannot open PDF files with ADO in VB6.is it so.
i placed CHECK_2045.dbf In MyTable and tried ur cde buttttt it could not find the MyTable
if u dont mind may i send u my project.
reply soon
Reply With Quote  
Join Date: Nov 2006
Posts: 712
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 97
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

Re: reading records from a .dbf file

  #15  
Jul 23rd, 2007
Hi,

Create Folder "MyDBF" in C
and place all dbfs's there in ("c:\MyDBF")
and use this code:
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDBF; Extended Properties=DBase IV"
rs.Open "Select * from CHECK_2005", con, adOpenForwardOnly, adLockOptimistic

Yes, u can send me the project. I will modify and return back.


Regards
Veena
Last edited by QVeen72 : Jul 23rd, 2007 at 7:53 am.
Reply With Quote  
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

  #16  
Jul 23rd, 2007
hi i was waitin for ur reply but u went offline. hey how to send projct to u.may i have ur mail id where i can send it .
reply now
regards
suneel
Originally Posted by QVeen72 View Post
Hi,

Create Folder "MyDBF" in C
and place all dbfs's there in ("c:\MyDBF")
and use this code:
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDBF; Extended Properties=DBase IV"
rs.Open "Select * from CHECK_2005", con, adOpenForwardOnly, adLockOptimistic

Yes, u can send me the project. I will modify and return back.


Regards
Veena
Reply With Quote  
Join Date: Nov 2006
Posts: 712
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 97
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

Re: reading records from a .dbf file

  #17  
Jul 23rd, 2007
Hi,

U can Zip and upload the proj here, or i have sent u pvt msg abt my email id

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

  #18  
Jul 23rd, 2007
ya i got ur pvt msg.
veena my gmail id is suneelkashmiri@gmail.com,rediff id is kar_suneel022@rediffmail.com
add me there .
modify the project and send it in my gmail id .
with regards
suneel kar



Originally Posted by QVeen72 View Post
Hi,

U can Zip and upload the proj here, or i have sent u pvt msg abt my email id

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

  #19  
Jul 23rd, 2007
hi veena
if possible give me ur gmail id i will be thankful to u.
regards
suneel kar
Reply With Quote  
Join Date: Jul 2007
Location: Philippines
Posts: 205
Reputation: jireh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 22
jireh's Avatar
jireh jireh is offline Offline
Posting Whiz in Training

Re: reading records from a .dbf file

  #20  
Jul 23rd, 2007
Hi Vee,

you know I'm confused, why we dont need to mention the dbf file but only their path?

the connection is now ok but there's still a problem on me here why I can't use it in a query? here's my code for that dbf.

Set db = OpenDatabase(App.Path & "\", False, False, "dBase IV;")
Set Data1.Recordset = db.OpenRecordset("select * from color where clrcode='" & Text1.Text & "'")
Is there something I should add in my query?
The error is in here
      Set Data1.Recordset = db.OpenRecordset("select * from color where clrcode='" & Text1.Text & "'")
Last edited by jireh : Jul 23rd, 2007 at 9:00 pm.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 3:55 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC