MDB To Flat File
I'm writing program from scratch:I have to read MDB tables and write in Flat File.Could any 1 pls. help me by showing the sample file.I really appreciate ur help.Thankx a lot
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Reading Flat File By First 3 Characters Of The Falt File Name???
--------------------------------------------------------------------------------
PRESENTLY I AM READING A FLAT FILE BY THE FOLLOWING CODE
lstrFileName = App.Path & "abcd.ini"
NOW I GOT A NEW REQUIREMENT WHERE IN I HAVE TO READ FLAT FILE IN THE DIRECTORY IF THE FIRST 4 CHARCTERS OF FLAT FILE NAME IS:
“Abc-“
flat file name may be "abc-xxx.txt"
I.E IF THE FLAT FILE HAS FIRST 4 CHARCATERS AS "abc-" THEN I HAVE TO READ THE FLAT FILE IRRESPECTIVE OF NEXT 3 CHARACTERS (xxx)
COULD ANY ONE HELP ME IN THIS?
THANKS IN ADVANCE
Deleting A Row In A Flat File With File System Object
Hi,
I am reading a flat file with the file system object as follows:
Sub UpdateFDDBUsers(CSM As TisClientServicesModule, Fso As FileSystemObject, SapFileTxt As TextStream)
Dim FDDBFile As File
Dim FDDBFileTxt As TextStream
Dim ReadSapFile As String
Dim LineBuf() As String
Set Fso = New FileSystemObject
Fso.DeleteFile (CSM.PathLocator.Path("FDDB") & "users.fddb")
Fso.CreateTextFile CSM.PathLocator.Path("FDDB") & "users.fddb", False
Set FDDBFile = Fso.GetFile(CSM.PathLocator.Path("FDDB") & "users.fddb")
Set FDDBFileTxt = FDDBFile.OpenAsTextStream(ForAppending)
Do While Not SapFileTxt.AtEndOfStream
ReadSapFile = SapFileTxt.ReadLine
LineBuf = Split(ReadSapFile, ",")
if LineBuf(0) = "D" then
' Here I need to delete a line of a the FDDBFileTxt file
end if
Loop
The question is, how do I delete a line from the file ?
Flat File
I need to be able to check a flat file for key phrases How can I do this:
Exampe.
ITEM_BLOCK MASTER_MAINTENANCE /ROW=3 /COL=7 &
/FACILITY=MENU_MASTER_MAINTENANCE
I need to look for /Facility in the block above..
Thanks
Brooke
Combobox, Apearance FLAT = NOT FLAT?
Hello group,
I prefer to use 'flat' textboxes (appearance = 0-Flat) and stuff. Why is it that a combox with the property appearance set to 0-flat isn't flat but 3d?
Can it be fixed?
Are there any other options?
regards,
VisualSander
How Many Items In Each Row Of A Flat File
I have a quote/comma delimited file like this:
"apple","orange","banana","grapes"
"carrot","tomato","peas","spinach"
With this example, it would be easy to say (assuming row & col 0 exist) that row 1:col 2 = "peas"
Since my app can use ANY quote/comma file, I want it to be flexible enough to determine, at runtime, if each row has 5 items or, for example, 500 items.
If I do this:
Code:
Open app.path & "myFlatFile.txt" for Input as #1
Do While Not EOF(1)
Input #1, myItem
Loop
Close #1
While looping, it would be nice to know if it has moved to the next line (or row). As soon as it does, if I had been counting, I would know exactly how many items exist in each row. This is what I need.
Thanks,
Joe
Importing Flat File
i am importing a flat file via a vba module in access. the file im importing contains several chr$(23) or end of transmission blocks. i dont want to have to manual remove them each time i import my file.
is there any way to have the import process ignore or remove the blocks and fill with a space?
thanks
Connect To Flat File
Hello
Is there a way to connect to a database that lies in a flat file under UNIX environment from VB ?
Thanks
Asit
Reading From Flat File
i have a flat file which contains the following information
Name: kumar
Country: USA
==============
name : armsstrong
country : canada
==============
name : william
country : england
I have a table structure as follows
NameCountry
I have to read the file and insert this into the table
Pls tell me how to proceed
Thanks in Advance
Flat File Problem
Hi,anybody who helps me was quitely appreciated.I am also newbie to vb.
The thing is suppose we are having a flat file having all the information regarding the nodes and elements.So here a Node can be made with x,y co-ordinates and an element is made of 4 nodes.So
the problem we have to find the redundant node i.e, a node not used at atleast once in making of an element.
for example take 1,2,3,4 ,5nodes are there
and elements like 1,2,3,4
but for 1st element we take nodes -->2,1,4,5
2nd element we take nodes-->1,4,2,5
3rd element we take nodes-->2,5,1,4
4 th element we take nodes -->5,1,2,4
so here 3 is the redundant node.(as we didnt used atleast once also in making anelement)
And i also requires the maximum values of x,y.So any advice is appreciated.The whoe information is in flatfile and i am attaching flat file for have a glance.
Flat File As Database
hello All,
How to use flat file as a database?
can anyone give an example?
thanks in advance,
Anita.
XML As A Flat File Database - HELP
I want to use XML as a flat file to store data. I want to use it like a database in a way but dont need all the fancy stuff. I dont want to use Access or SQL, or anything that requires a seperate server, thats why i would like to use XML. I need help pulling the data from the XML document, Adding to the XML document, and Editing/Removing from the XML document. Here is my problem, most of the examples on the net do not explain the manipulation of data in an xml document, anyone have any GOOD advice on/for XML and VB. Thanks
Adding To A Flat File
Hi,
I want to write a line of info to a flat file every time an error occurs (an error log!). I'm fine with the code for opening a file, writting data and closing, but VB overwrites the info that was previously in the file.
How do I add to a flat file, rather than overwriting it?
Cheers,
Jez
Flat File Upload
Object :
Try to upload data from flatfile (Excel) to upload into FlexiGrid / DBGrid.
Problem :
Its uploading the data from Excel sheet into FlexiGrid / DBGrid.
Some of the data are not uploaded into the Grid.
Reason if the Excel column mixed with Numeric and Text, it uploads only Numeric data, if numeric data comes first (row) in the column. It uploads Text, if Text type data comes first and leaves all the Numeric data.
Flat-file To MS Access
I need to compare data from a flat file with an Excel worksheet. Since am unable to do so, i thought of transfering data from flat file to MS Access and then comparing data from Access and Excel.
My problem is:
1) is my technique right???
2) How do we copy data from flat-file to Access usin VB???
My flat file has contents :TSP-BCH-DevProf-11 FAIL Feb 24 21:46:53 Proper log message not found
TSP-BRKN-DevProf-03 PASS Feb 24 21:46:56 As per ldap search result
TSP-FTLR-DevProf-25 FAIL Feb 24 21:48:03 Proper log message not found
TSP-FTLR-DevProf-29 FAIL Feb 24 21:48:34 Proper log message not found
TSP-FTLR-DevProf-38 FAIL Feb 24 21:53:06 Proper log message not found
TSP-FTLR-DevProf-51 FAIL Feb 24 22:06:26 Received Data on Origin Server didn't match the expected.
TSP-FTLR-DevProf-66 FAIL Feb 24 22:12:33 Received Data on Origin Server didn't match the expected.
TSP-SYNTX-DevProf-01 FAIL Feb 24 22:14:47 Received Data on Origin Server didn't match the expected.
:
:
:
i want the data in a tabular format. Can somebody help me??
Updating A Flat File.
Hello all,
Please help:
I am using a VB program to take a specific record from a file and update it and then write it back out to the file.
Layout of the file
20051009,6,5,6,9
20051016,8,8,9,4
20051023,1,2,3,1
The first field is a date. I am taking the field for 20051023 and adding data to it, then I want to rewrite it out to the file.
My file is looking like this:
20051009,6,5,6,9
20051016,8,8,9,4
20051023,1,2,3,1
20051023,3,4,6,9
I want it to look like this:
20051009,6,5,6,9
20051016,8,8,9,4
20051023,3,4,6,9
Any ideas? I am opening the file as append.
Thanks a lot!
Flat File Manipulation
I am writing an application that scans text files and allows the user to
delete lines based on criteria in that line being met. How do you delete a
line and then back space it so that there is no space between lines of text?
Example:
This is a line of sample data.
This is another line of sample data.
I want to be able to remove the empty line between the two lines of data.
Thanx in advance for your help.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
RDBMS Or Flat File?
Where is more efficient to store images, in SQL Databases or in native File. eg .jpg, .gif etc
Flat File Problem
Hi,anybody who helps me was quitely appreciated.
The thing is suppose we are having a flat file having all the information regarding the nodes and elements.So here a Node can be made with x,y co-ordinates and an element is made of 4 nodes.So
the problem we have to find the redundant node i.e, a node not used at atleast once in making of an element.
for example take 1,2,3,4 ,5nodes are there
and elements like 1,2,3,4
but for 1st element we take nodes -->2,1,4,5
2nd element we take nodes-->1,4,2,5
3rd element we take nodes-->2,5,1,4
4 th element we take nodes -->5,1,2,4
so here 3 is the redundant node.(as we didnt used atleast once also in making anelement)
And i also requires the maximum values of x,y.So any advice is appreciated.The wholw information is in flatfile and i am attaching flt file for have a glance.
Flat File Database
I Would like to Create a Flat File Database, that will accept entries from the VB application, and can only be read by the VB application.
the best example would be ICQ db file.
how would I go about doing this ??
Thanks
HEADER For Flat File
Help, I'm trying to insert a header into a flat file.
Example: (of what it would look like)
PCD080720003 (HEADER)
020,DC,062100,I0FJIW,012,0002395,Jones,
020,DC,062100,I0FJIW,012,0002395,Gabrell,
020,DC,062100,I0FJIW,012,0002395,Smith,
...... My question is this, ... the header needs to supply:
first 3 digits is: PCD
second the date: todays date
third the number of records in the file: 3
I know how to count the records but how do I display todays date and hard-code the PCD (the 1st 3 digits)
then how to I insert this at the top line of an existing file. I did have the header in 1 file and then was going to do an "APPEND" in the line input comand of the records to the header file. I feel like there is a lot simpler way to do this.
Thanks in advance for your help!
Access To Flat File
Is there an object and method that will dump the contents of an access table into a ascii text file? Will this method delete the records in access when it dumps the table, and if not can I have it delete it? I have just scrolled through the recordset in the past and wrote to the flat file manually, but I thought there was an easier way. It needs to be a comma separated value file as well.
Thanks!
Need VBA Code To Make Flat File
I usually never use flat files (I prefer using a database) but I have a client that needs to be able to convert his Access database table into a flat file with fixed field lengths. I know how to help him extract his table manually using an Access wizard which will give him the desired result; however, that is a long and tedious method to use day-in and day-out. I'd like to help him get a more automated method going (ie. a VBA module or something). Any ideas (code samples, etc.)?
Thanks in advance,
sl8rz
Flat File Database - Online
Would it be possible to hold some information on my FTP server, which can be:
a. Read
b. Written To
By the user?
In other words, a flatfile database?
So I could for example, hold some information inside the 'info.txt' file like:
#1 , name , pass
#2 , name2 , pass2
etc.
I hope someone could be of help, thanks in advance,
Gaz
Loading From A Flat (txt) File To Listbox
I have an input file similar to the one below:-
- The first 6 characters (1,6) for all rows would be the same . Following this
- in the first row (7,1 st position) there will be some 1 digit
- in the second row there will be EOL(7,3 rd position), followed by 9 Characters (H6E016094)(10,9 th position)
- in the third row there will be 95 followed by 7 digits (4125159) (9,7 th position)
2188571
218857EOLH6E016094
218857954125159
How do I strip these fields from file and diplay that in a form inside a List Box. Below is how I expect to see the value from the file to be displayed.
Column1Column2 Column3 Column4
1 EOL H6E016094 954125159
Is using Listbox is the correct approach or how do I go about?
Flat Text File To Excel
Hello!
I am attempting to use VB to open and read a flat non delimited sequential text file and write it to an existing excel spreadsheet. The code I have thus far is:
Private Sub cmdStart_Click()
Dim objExcelApp As Excel.Application
Dim objWorksheet As Workbooks
Dim strClmn As String, strData As String
Set objExcelApp = CreateObject("Excel.Application")
Set objWorksheet = objExcelApp.Workbooks
objExcelApp.Workbooks.Open "c:QMTemp.xls"
Open "c:QBK20023.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, strClmn
If Left(strClmn, 1, 4) = "00BK" Then
objExcelApp.Primary.D8 = Left(strClmn, 5, 8)
objExcelApp.Primary.D10 = Left(strClmn, 9)
objExcelApp.Primary.D12 = Left(strClmn, 10)
objExcelApp.Primary.D14 = Left(strClmn, 11, 40)
objExcelApp.Primary.D16 = Left(strClmn, 41, 48)
Else
End If
Loop
Close #1
End Sub
When I attemp to run the program I get an error that highlights the first line with the message:
USER DEFINED TYPE NOT DEFINED
Can anyone help me out with code that
opens a text file and populates cells in an existing excel spreadsheet with data from the text file.
I could use TextPad to insert delimiters in the flat file, but I was hoping to use VB to do everything.
Any help or suggestions are appreciated!
Export From Flat File To Access
I am having one Flat file(txt) inside the file i am having some values which is separeted ",". I want this values to export to Access database using VB ActiveX Dll .
can any1 help me out how to do that..
or elzz any code???????????
adv thanxx,
kandan
Best Data Format For VB? (db/flat File)
I am about to start creating an application in VB and I am curious what other VB programmers think is the est way to store data.
Most of the applications in the past I have used Access.
For this one however, I don't just want an Access table sitting on the computer that any old user with Access can open.
I'd prefer a dat file that when opened looks like a bunch of garbage.
Does anyone have suggestions for/against either Access or another method?
How To Designing A Flat File Report In VB6.0
Can anybody answer me
How can I create a flat file report using VB6.0 and can design that report in a rich text format
(.rtf) and can send for printing . The data to be retrieved to the file from Access database, i.e. VB6.0 retrieves data from Access database and prints the report in Text format/in a Flat file.
Chitta
Flat File Create Vb Report
I have already created an sql report to bring back the information required from a specific database from about 4 tables.
Now i need to create the same flat file output report in Visual basic, and not sure what to do or how to transfer.
The file in visual basic needs to have specific spacing requirements between information as well as order example below.
v1.20 name1employee last2employee birthdate address city
v1.20 employee's spousename employee's spouse lastname .... and so on
Please help.
Thanks
Best Way To Read And Process A Flat File
Hi,
I'm trying to write a monitoring tool which will take a flat, fixed length file (or files) and report on the findings.
I've used VBa in Access for a number of years and normally I would just import into a table, however for the VB application, there are no tables, no database.
The file will be reported to a list box and a number of readonly text fields, allowing the user to view the current status.
The best I've found to do this is to convert it to CSV and process via an ODBC link. This obviously creates a large (and probably unnecessary) overhead on processing, as the log is written to (and therefore monitored) 24/7.
I cannot change the source file, however, this file is copied locally to allow for easier processing.
Can anyone suggest a better way of reading the file and point me in a direction.
Many thanks in anticipation,
Fitz
Did you know, there are 10 types of people in this world:
* Those who understand binary
and
* Those who Don't!!
Excell Flat File System - HELP
I am making a system which allows users to enter details about their Birthday etc
Ill just use one example section...
What i want is to make a form in vb with a box for user name and a combobox where the user can select the month of their birthday
The Excel worksheet will look something like this
January Febuary........
User ID
8845
4627
When they user Enters their ID and selects their month they then press a command button which automatically enters their chosen month into the worksheet, by colouring the cell yellow. When they click proceed it also takes them to the worksheet to view their booking
well i hope you can help and undertand what im trying to do
Thanks in Advance
Andy
Extract Email To Flat File
Is it possible (and is a sample available) to automate the
export of an email message to a .txt file. The scenario would be
- Outlook 2000 inbox receives message
- Rule kicks of a macro or VBA app that automatically exports
the message text to a .txt file on a network or local drive.
Thanks
Count Rows In Flat File
Hello-
Can anyone help me in counting the number of rows that are existing in a flat file with tab delimited...
thanks in advance.
Check If Flat File Exists On Server...
Hi all,
I have a DTS package that relies on a flat file on the server. As a result, I need to check for its existance. It would be quite simple, except for the fact that when the file is sent to the server, it is tagged with a date at the end. So, for example, my file name is "MyFile" and it is sent to the server as "MyFile06192006". What also makes it difficult is that the datestamp isn't always the current date (it's a date regarding the data inside). The DTS package is currently set up to handle files without the date stamp using FSO.FileExists. No matter what I try, I can't seem to look at the file without the date stamp. Anyone have some ideas?
DTS- ActiveX (VBScript) To Import Flat File
I have a fixed length text file that I wish to import into SQL tables.
The text file will contain 2 different types of records. Firstly, a
header record, which is immediately followed by X number of detail
records.
Each record is 80 characters long, separated by a CRLF, and the type
of record is identified at the beginning (first 2 char's).
I would like to insert the header records into a header table,
returning the unique ID (auto incrementing ID) of the row inserted
into the header table, which will be used when inserting the
associated detail records.
Does anybody have any sample ActiveX scripts that do something similar
to the above that I can use in a SQL DTS package?
Basically, I'm after an example script that opens a file, loops around
each row in the file and tests the data in some means.
Any examples would be absolutely fantastic and much appreciated!
Many thanks
Anthony
Copying Data From Flat File To Clipboard
Hi Guys,
I have some code here that open some files and copies whole data to a variable.
Code:
Dim FileNum As Integer
Dim TotalFile As String
Open "c: est.csv" For Binary As #FileNum
TotalFile = Space(LOF(FileNum))
Get #FileNum, , TotalFile
Debug.Print TotalFile
Close #FileNum
I tried assigning text to clipboard by using the following command
Code:
Clipboard.SetText TotalFile
Aand i try to print out data from clipboard using this command but it return "0"
Code:
Debug.Print Clipboard.GetData()
Does anyone know what is the cause?
Insert Flat File To Access Db Using VB Error On One PC
For some reason the below code works on all PCs but there is one company that it will not work for. They have tried on several PCs and everytime they get an error saying that the query fields are not the same. This usually makes sense and I just replace the database and it works. For some reason the text file matches the database table and it still will not work. I have tested the program on my pc using there databases and it works fine with both examples below. I am thinking that it is something to do with the text driver so I tried the second example below and with that example 2 only the first column of data is insterted into the table. I have used the mdac compenent checker and ther are no mismatch files. Any other suggestions as to what compenent to check or a reason why it will work on hundreds of other customers PCs but not at one location?
example 1
strCn = "Driver={Microsoft Text Driver (*.txt; *.csv)};" & _
"DBQ=" & App.Path & ";" & _
"DefaultDir=" & App.Path & ";" & _
"Uid=Admin;Pwd=;"
strSql = "INSERT INTO [" & FileName & "] IN '" & dbLocation & "'"
strSql = strSql & " SELECT * FROM " & TextFile
frmftp.adoCn.Execute strSql, a
example 2
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbLocation
Dim counter As String
counter = InStrRev(TextFile, "")
textfile1 = Left(TextFile, InStrRev(TextFile, ""))
textfile2 = Right(TextFile, Len(TextFile) - counter)
textfile1 = "[Text;Database=" & textfile1 & ";HDcn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbLocationR=YES].[" & textfile2 & "]"
cn.Execute "Insert INTO " & FileName & " select * FROM " & textfile1
How To Export Flat File Data In To Msflexgrid
How to export flat file data in to msflexgrid where delemeter like(; ' " " , / etc) how it will possible?
flat file like this.....
0010792120;;Dept of Justice;;Megan;Pullin;;5/452;Flinders St - FINANCE;MELBOURNE;VIC;3000;;;0010488584
0010792754;;Albury Wodonga Stock Agents;;Alan;Jilkington;;;PO Box 733;WODONGA;VIC;3689;;;0010487579
0010792758;;Planright;;Jacqui;,;;21;Nish St;ECHUCA;VIC;3564;;;0010487572
0010792761;;Palaga Pty Ltd;;caroline;,;;218;Great Western Hwy;WENTWORTH FALLS;NSW;2782;;;0010487564
0010792772;;AJ Raymond Accountant;;Arthur;Raymond;;;PO Box 57;WOONONA;NSW;2517;;;0010487749
0010792780;;DA & CR Knight Pty Ltd;;Tanya;Knight;;197;Percy St;PORTLAND;VIC;3305;;;0010487736
pls. do for need full for me..
Thanks & Regards
Anuj12
Read Flat File By Line Number
I am working with binary search algorithm with an array of over 1 million items its a little too much to store in memory so I was thinking of using a flat file, how could I tell the bsa to access the flat file list, is there a way to read in say line 250,000 of the flat file and just that line or is it done a different way?
Thanks in advance
Other Ways To Put Flat File Into Access Database
I had a problem yesterday with this code below not working at a company
strCn = "Driver={Microsoft Text Driver (*.txt; *.csv)};" & _
"DBQ=" & App.Path & ";" & _
"DefaultDir=" & App.Path & ";" & _
"Uid=Admin;Pwd=;"
Set frmftp.adoCn = New ADODB.Connection
frmftp.adoCn.Open strCn
strSql = "INSERT INTO [" & FileName & "] IN '" & dbLocation & "'"
strSql = strSql & " SELECT * FROM " & TextFile
frmftp.adoCn.Execute strSql, a
I am wondering if there are other ways to accomplish this task without using the instert statement and not looping through? I have been searching but the only thing that I can find is the Instert statement.
Thanks
DrunkenMunk
|