| | |
connect to text file database
![]() |
•
•
Join Date: Mar 2003
Posts: 1
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
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
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
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..
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..
•
•
Join Date: Mar 2009
Posts: 1,219
Reputation:
Solved Threads: 221
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
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
Thanks
![]() |
Similar Threads
- Storing Text file in Database through VB (Visual Basic 4 / 5 / 6)
- Insert Contents Of Text File Into Database (ASP.NET)
- read text file (C)
- conversion of text file into data base file (Visual Basic 4 / 5 / 6)
- read text file (C#)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Copy all folder contents to specified location(pls help)
- Next Thread: Can u your helpme about Visual Basic 6.0
Views: 12775 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 2007 access activex add ado append application array banned basic bmp box client code coffeehouse college column connectionproblemusingvb6usingoledb convert copy creative database date designer desktop dissertations dissertationthesis edit error excel filter flex form game header ide image implements inboxinvb installation installer interaction keypress listview machine mail measure memory noob number open oracle os outlook password pause pdf picture pos prime print problem program programmer query random range range-objects readfile record registration report retrieve save search sites size spectateswamp sql string struct subroutine table textbox time timer variable variables vb vb6 vb6.0 vba vista visual visualbasic web window windows






