connect to text file database

Reply

Join Date: Mar 2003
Posts: 1
Reputation: MrMie is an unknown quantity at this point 
Solved Threads: 0
MrMie MrMie is offline Offline
Newbie Poster

connect to text file database

 
0
  #1
Mar 18th, 2003
Hi all..

im kinda new to vb..i tried to connect my data control to a text file generated by my visual data manager, but every time i tried to run the app..it says that i dont give a right location for my file, i dont specified the location from the properties but instead i used

With datDB
.DatabaseName = App.Path & "\mytxt.txt"
.RecordSource = "Names"
End With

is there something i miss ?

and second question is, how to distribute my .exe without the MSVBVM60.DLL ?

TQ in advance
Reply With Quote Quick reply to this message  
Join Date: Dec 2002
Posts: 461
Reputation: waynespangler is on a distinguished road 
Solved Threads: 56
waynespangler waynespangler is offline Offline
Posting Pro in Training
 
0
  #2
Mar 19th, 2003
The data control can't hook up with a text file. You will need to create a Access data base (.db) and put your data into it for the data control to work.
The answer to your next question is "You can't". Use the setup in vb so all needed files are put together.... Unless the other computer already has the files on them.
Wayne
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 10
Reputation: KSS is an unknown quantity at this point 
Solved Threads: 1
KSS's Avatar
KSS KSS is offline Offline
Newbie Poster

Re: connect to text file database

 
0
  #3
Mar 29th, 2009
You can open your text file using another way instead of data control(which is impossible).

If you want to open the ".txt" file here is an example:
---------------------------------------------------------------
''This code will open a text file and show it in a listbox..

Dim myfile as String
Dim data as string

myfile = app.Path & "\test.txt"
open myfile for input as #1
do while not eof(1)
line input #1,data
list1.additem data
loop
close #1


---------------------------------------------------------------
I hope that i helped you..
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 770
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 136
vb5prgrmr vb5prgrmr is offline Offline
Master Poster

Re: connect to text file database

 
0
  #4
Mar 29th, 2009
waynespangler & KSS,

Gentlemen/Ladies,

Unfortunantly you are both wrong. The data control can connect to text files.

MrMie,

You need to set up your databasename to the folder that contains the text file (app.path). Then setup the recordsource to the name of the file (no extension as you are using the dao/jet text driver) (recordsource = "mytext"). However, in the properties you have to set the connect property to Text;.

Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC