943,917 Members | Top Members by Rank

Ad:
Mar 18th, 2003
0

connect to text file database

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
MrMie is offline Offline
1 posts
since Mar 2003
Mar 19th, 2003
0
Re: connect to text file database
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
Reputation Points: 84
Solved Threads: 58
Posting Pro in Training
waynespangler is offline Offline
461 posts
since Dec 2002
Mar 29th, 2009
0

Re: connect to text file database

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..
KSS
Reputation Points: 11
Solved Threads: 3
Newbie Poster
KSS is offline Offline
21 posts
since Mar 2009
Mar 29th, 2009
0

Re: connect to text file database

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
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
vb5prgrmr is offline Offline
1,670 posts
since Mar 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Copy all folder contents to specified location(pls help)
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Can u your helpme about Visual Basic 6.0





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC