Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Sequential Access


Hi i'm having a problem with space between my output file.

Open App.Path & "file.txt" For Append As #1
Print #1, strFname & ",", strLname
Close #1

When i view the file.txt there's a big gap between the strFname and strLname. For instance: Jane, <spaces here> Dumas

That's not i want, i want them to appear as Jane,Dumas without the big gap there. Anyone helps will greatly appreciated




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Sequential Access Help!
I'm having a proble reading multiple line in a sequential file. Here are the instructions I have:

____________________________________________________

In this exercise you will open, read write, close, and print a sequential file.



Scenario: Boggs, Inc. wants an application that will allow the user to enter the inventory number, quantity, and price of each item in inventory. The application should allow the user to record this information in a sequential access file named la3.dat on your disk. In addition, the application should allow the user to print a report showing the inventory number, quantity, and price of each inventory item as well as the average price. (Hint: to calculate the average price, multiply each item’s quantity by its price; add these amounts together, then divide that sum by the total quantity of all items in the inventory.



The problem I’m having is calculating the average price. I’m not sure of the coding for adding the total price and total quantity for each line in the sequential file.

Here's the code I have so far

Private Sub cmdPrint_Click()
Dim strInven As String, strQuan As String, strPrice As String, strtotQt As String
Dim strline As String, strtotPr As String, strAve As String
strInven = txtInven.Text
strQuan = Val(txtQuan.Text)
strPrice = Val(txtPrice.Text)
'accumulate totals
strline = strQuan * strPrice
strtotPr = strline + strline
strtotQt = strQuan + strQuan
strAve = strtotPr / strtotQt
Printer.Print Tab(5); "Inventory Number"; Tab(25); "Quantity"; Tab(40); "Item Price"
Open "C:Documents and SettingsRobDesktopla3.dat" For Input As #1

Do While Not EOF(1) ' Loop until end of file.
Input #1, strInven, strQuan, strPrice ' Read data into variables.
Printer.Print Tab(5); strInven; Tab(25); strQuan; Tab(40); strPrice ' Print data.
'accumulate totals
strline = strQuan * strPrice
strtotPr = strline + strline
strtotQt = strQuan + strQuan
strAve = strtotPr / strtotQt
Loop
Printer.Print
Printer.Print Tab(5); "Average Price:"; strAve

Close #1
Printer.EndDoc


End Sub

Anyone have any ideas??

Sequential Access
im trying to read a .txt-file by sequential access.

"one";"two";"three";
"four";"five","six";

to do so i have the following code:




Code:
Private Sub CmdExtract_Click()

Dim nfile As Integer
nfile = FreeFile
Open "C:Documents and SettingsTESTCLIENTDesktopcijfers.txt" For Input As #nfile

Input #nfile, first, second, third

MsgBox (first)
MsgBox (second)
MsgBox (third)
Close #nfile

End Sub



the first msgbox gives me the correct value (one), but the second gives me (;"two";"three" and the third (four)...

it's obvious that there is a problem with the delimiters...i can always read in the whole string and then get the values with stringmanipulation... But why is it that almost all MS applications like access and excell do not have a problem reading sequential files delimited by semicolons and VB does so?

Sequential Access
Here's what I got.
Two forms. The first form has a drop-down menu (Clients) with items "add, edit and delete". these three access a client form with txtboxes to enter their info. When you click the "add" item you get an inputbox for a record number. If you enter a # that already exists you get an error message. Edit and delete also get you a blank client form.
This is what I need.
For the txtboxes to be filled in with the info of existing clients when you click edit or delete and the txtrecord box to have the number that the user enters in the inputbox when they click add.



Chris

More Sequential Access Files
Is there any way to read from a specified line #, or edit a specified line #?

Sequential File Access
I am trying to read from a file with 4 record a random record and
display it to a text box.
The code is below.
I get the random number generator to work fine but have problem
passing that value to the line read statement.
Any Ideas?


Private Sub cmdRead_Click()

Dim MyValue 'declare value to store a random number
Dim TextLine As String 'Declare variable to store line from file test.txt
Open "c:TEST.txt" For Input As #1 ' Open file for reading.
Randomize ' Initialize random-number generator.
MyValue = Int((4 * Rnd) + 1) ' Generate random value between 1 and 4.
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, TextLine ' Read line into variable.
TextLine=MyValue
Text1.Text = TextLine ' Print to the text box window.
Loop
Close #1 ' Close file.

End Sub

Sequential Access Files
For this project, I have to store records of candy prices in candy.txt, s far I've bene using it jsut like

Name
Price
Name
Price

in that format. Now the time comes to display in nicely in a list box, and I'm not sure how to do that, because its a "edit record" screen, so I figred I'd make a 2D array:


Code:
Open "candy.txt" For Input As #1
i = 0
Do While Not EOF(1)
Line Input #1, Variable
i = i + 1
Loop
i = (i / 2) - 1
Dim Candies(1, i)
Close #1

Now the problem is apparently I can't have non-constants when dimming an array. Any suggestions on another way of doing this? (Im open to total change of how to edit it, too)

Sequential Access Files
Is it possible to read from a file and print the information in a report format, similar to a chart?

Sequential File Access!
I want to read a file of numbers!

Each number is seperated by a tab.

I have 7 rows of numbers, seperated by tabs, and I wanna pass these numbers into an single dimension Array in my program.

Help!!

Sequential Access Files
Does anyone know how to check to see if a file is already open.

I have a file in a loop but when it executes the loop the second time it says FILE ALREAY OPEN.
I had originally fixed this with a boolean but I don't want to do that.

I need something like

IF File#1.AlreadyOpen Then
''''''
END IF

Can someone help?

Sequential Access File...need Help!
I've written an address book program using sequential access. I can get it to read the first record and can write to the file. Can anyone tell me how to move thru the records to view them (previous and next) and how to delete a record from the file?

Thanks loads!

Sequential Access Files
I am coding an application that will read the file from a .dat file, then it loads the contents to a Combo Box but once the contents are loaded into the combo box i want to be able to click in any of the records and automatically send that record ( the name of the record) to a text box.


Can anybody help?

Sequential Access Files
I am just learning VB, and I have started to learn now how to read and write sequential access files. The following is my code for part of my program, and I can't quite figure out what is wrong.


Code:
Private Sub Command5_Click()
Open "C:WINDOWSDesktopBrett's StuffVisual Basic ProgramsRandom Number GameHigh Scores.txt" For Output As #FileName
Print #FileName, HighScore1
Print #FileName, HighScore2
Print #FileName, HighScore3
Print #FileName, HighScoreName1
Print #FileName, HighScoreName2
Print #FileName, HighScoreName3
Close #FileName
End Sub

Private Sub Command6_Click()
Open "C:WINDOWSDesktopBrett's StuffVisual Basic ProgramsRandom Number GameHigh Scores.txt" For Input As #FileName
Line Input #FileName, HighScore1
Line Input #FileName, HighScore2
Line Input #FileName, HighScore3
Line Input #FileName, HighScoreName1
Line Input #FileName, HighScoreName1
Line Input #FileName, HighScoreName1
Close #FileName
End Sub


The former subroutine works fine - the appropriate variable names appear in High Scores.txt. However, when I click on Command6 to load them, I get a "Type Mismatch" error. Any ideas on what I did wrong?

Sequential Access Files
I know how to use sequential access files and everything. When I open a file for output (e.g. Open "c:coords.txt" For Output As #1) and write to the file (Write #1, intExample) quotes are placed around the data that I put into the file. Does anyone know how to do this without the quotes? Thanks.

Sequential Access File
OK I have a project which has to use a sequential access file.

I can not use a .mdb file (drat!)
Anyways I can populate a listbox with the first field of the data (there are 5 fields per record). The listbox's populates fine.

Now when I click on (1) of the listbox entries
I want the (second field) to show up in a textbox
the (Third field) to show up on a second text box...and so on.

My question is simply this...How do you set the record pointer in a sequential access file to look at the specified field?

I tried an array, using the listbox.listindex...but to no avail.


Why the heck can't this client just use a .MDB???


Help!
Lee
...Hmmm no one knows??????????

[Edited by Lee M. on 01-09-2001 at 11:47 PM]

Help With Sequential Access Files
Create an application that read a series of numbers from a sequential access file. Each series is separated by a 0. The program should then calculate the average of each series of numbers and an average of all averages. Display your answers in a label on the form.



Test your program thoroughly!

Data File:
10 15 20 20 0 1 2 3 4 5 6 7 8 0 10 20 30 40 50 60 09 9 9 9 99 9 9 9 0 5 8 9 5 3 80 2 23 65 0 Will someone please help me with this assignment I am literally stuck, it is already late, and I don't understand it. Would someone please just walk me through it at least, or get me going on it? I appreciate any help you can give me, thank you so much.

Sequential Access Files
I am trying to create an application that will calculate both the total number of items sold and the total number sold by item. The application should also allow the user to print the interface.

For coding the calculate total option, i need to calculate the total number sold for all the items in the .dat file. I also need to display an appropriate message along with the total in a lbl control. (For example, "the total number sold is 300"...)

For coding the calculate by item option, i need to calculate the total sold from the .dat file for only the item the user selects in the list box. (For example, the user selects ABC11, only show total for that item.) Also display a message("the total number for item ABC11 is :")

Here is what i have so far for the entire form: However, it does not work correctly. _________________________________________________________
Private Sub mnuStatisticsItem_Click()
Const conMsg As String = "The total number sold for item ... is: "
Dim strItem1 As String, sngCItemSold As Single
Open "a:/lc5.dat" For Input As #1
Do While Not EOF(1)
Input #1, strItem1, sngCItemSold
Select Case strItem1
Case "ABC21"
lblTotal.Caption = Val(strItem1) + sngCItemSold
Case "BDE23"
lblTotal.Caption = Val(strItem1) + sngCItemSold
Case "VFE54"
lblTotal.Caption = Val(strItem1) + sngCItemSold
End Select
Loop
Close #1
End Sub

Private Sub mnuStatisticsTotal_Click()
Const conMsg As String = "The Total Number Sold is: "
Dim sngTItemSold As Single, sngCItemSold As Single, strItem1 As String
Open "a:lc5.dat" For Input As #1
Do While Not EOF(1)
Input #1, strItem1, sngTItemSold
lblTotal.Caption = conMsg & Val(strItem1) + sngTItemSold
Loop
Close #1






Genny Steele

Sequential File Access
I have a question that has to deal with sequential file access. Before i get to my main question, I'm going to give you some sample code to help you better understand my prediciment.
private Sub cmdCheckIn_Click()
frmLogs.List1.AddItem ("date and time checked in: " & date & " - " & time)
End Sub

private Sub cmdCheckOut_Click()
frmLogs.List2.AddItem ("date and time checked out: " & date & " - " & time)
End Sub

private Sub Form_Load()
Open App.Path & "Log.123" for input as #1
get #1,
End Sub

private Sub Form_Unload(Cancel as Integer)
Dim a as Variant
Dim b as Variant
Dim I as Variant
for I = 0 to ListCount - 1
a = List1.List(I)
b = List2.List(I)
Open App.Path & "Log.123" for Append as #1
print #1, a
print #1, b
next
Close #1
End Sub


The place that has Get #1, is where I'm having my trouble. I need to know the other way of reading from files. (It goes along with Print #1, Write #1) and so on. If you can help me on this matter, I would be most grateful.

Sequential Access Files
Hello. I am trying to complete a problem and I am stuck. I have a menu with two choices: Calculate Total and Calculate by Item. When I click the Cal. Total button it is supposed to calculate the total number sold for all of the items in my dat. file which I put below:

"BDX22",100
"ABC11",150
"BDX22",250
"CVA33",100
"ABC11",300

When I click the cal. by item button, it is supposed to calculate the total sold from the dat. file for only the item the user chooses in the list box.

Could someone please look at my code below and help me out. I can not figure out what I need to do to get my program right. I would really appreciate it and reward with high points. Thank you.

Private Sub mnuStatisticsItem_Click()
'declaring variables
Const conMsg2 As String = "The total number sold for item "
Dim intTotal2 As Integer
Dim strPS1 As String, strPS2 As String
'open the data file
Open "C:VBDATA1071-4Tut06lc5.dat" For Input As #1
'start loop
Do While Not EOF(1)
Input #1, strPS1, strPS2 'reads records from dat. file
'accumulate totals
intTotal2 = intTotal2 + strPS2
'ending the loop and closing the file
Loop
Close #1
lblTotal.Caption = conMsg2 & strPS2


End Sub

Private Sub mnuStatisticsTotal_Click()
'declaring variables
Const conMsg1 As String = "The total number sold is "
Dim intTotal As Integer
Dim strPS1 As String, strPS2 As String
'open the data file
Open "C:VBDATA1071-4Tut06lc5.dat" For Input As #1
'start loop
Do While Not EOF(1)
Input #1, strPS1, strPS2 'reads records from dat. file
'accumulate totals
intTotal = intTotal + Val(strPS2)
'ending the loop and closing the file
Loop
Close #1
lblTotal.Caption = conMsg1 & strPS2

End Sub

Help! Reading A Sequential Access File?
I'm writing a program that will read a file named "lc2.dat". The file has this text:

"Mary","Female",21
"Terri","Female",18
"Jim","Male",33
"George","Male",45
"Paula","Female",53
"Fred","Male",25

My program has to read this file and get the average age of the males and the average age of the females. I have no problem getting the average age of all together, but I can't figure out how to get it to tell between male and female ages. I also had to tell how many males and how many females there are and I got that to work I just need help with the ages.


Code:
Private Sub cmdDisplay_Click()
Open "a:/lc2.dat" For Input As #1
Do While Not EOF(1)
Input #1, strName, strSex, intAge
If strSex = "Male" Then
intCounterM = intCounterM + 1
Else
intCounterF = intCounterF + 1
End If
Loop
Close #1
lblMales.Caption = intCounterM
lblFemales.Caption = intCounterF
End Sub

Access Sequential Variables In A Loop?
An annoying problem. Using VBScript (for Simatic ProTools), I'm trying to have a loop write from a TextStream input to a PLC via "tags". Tags show up as named variables, in this case as:

V600, V602, V604, ...., V662

Here's the loop:

Code:

i = 0

Do While ts.AtEndOfStream <> True 'exit at end of filestream
returnstring = ts.ReadLine 'returns full line of text
commaloc = InStr(1, returnstring, ",") - 1 'find distance to comma
returnstring = Left(returnstring, commaloc) 'delete comma

V[600+2*i] = returnstring
i=i+1
Loop

Normally I'd just use an array to take care of this, but unfortunately that's not an option in this case. I have to use the named Variables V600 etc.

Is there an easy way to tell VB to look at the variable named V600 instead of it seeing V[600+2*i] (I'm using "[" instead of "(" for clarity that its not an array)?

If not, is my best bet just to create another array V(), store the values in that during the loop, then have:

Code:
v600 = v(0)
v602 = v(1)
v604.....
Thanks!

Random Or Sequential-access Files?
Well, I am in the long process of making a chat program and I have a server and a client. The server will have a list of all the registered users and certain info about them, such as: name, password, ip, local host name, etc. Every time that someone new registers I want the info to be added to the end of the file. And when I start the server, I want to load all the info onto a list. But here is where I am stuck. Should I use random-access files or sequential-access files? With random access, I could just load each record and put it in the list with the split command and what not, but when I load each record and I make my For loop, what number do I go to, how do I know how many records there are in the file? Thanks for any help...

If You'd Like To Access A Sequential File Randomly
Hello friends,
If you wish to access your CSV or any field separated text files or data files randomly then here is a control which may be of use to you... I put here the ocx. you can read the documentation and then use it in your work. If you like/dont like it just mail me.
VJ

Opening Files (Not For Sequential Access)
Hello,

Recently we have ventured into a project that will require us to open an acrobat file for the user to read.

I know how to open the acrobat.exe file with the Shell function, and I could sendkeys to it to open the file that I want, but I am wandering if there is a way to open a file in one motion, or at least a better way.

Thanks for the help,

Mike Lyter

Sequential Access File Help Needed
ok i have a program that stores a bunch of different data in a .dat file. And I want to know if there is a way that you can update or re-write a line of information. Or if it would be easier to use random access file.
    Thanks, Greg

           All your base are belong to me
               ( º)> ~ <(º.º)> ~ <(º )

Reading A Record From A Sequential Access File
[ hey there ]

I'm having problems with reading a record from a sequential access file.
I'm stuck once again on comin up with the proper code from the mnuEdit command for an application project i'm working on.

so far, the code i have is the following...

Private Sub mnuEdit_Click()
Dim strLName As String
Const conprompt As String = "Enter the Contact's Last Name"
Const contitle As String = "Contact's Last Name"
strLName = InputBox(contitle, conprompt)
Open App.Path & "contact.dat" For Input As #1 'open sequential file


....so then what? I'm stuck and not too sure what should happen next.
any suggestions and or help would be gratefully appreciated as always.

thank you!

Declaring A Path To Be Used For Sequential File Access
I am working on the May Challenge, the Alarm Clock.
I'm going to make 2 programs, one for setting the alarm, and another that runs in the systray to check if the current time matches the one stored into a file.
Now this file that I use the #write statement to create is in the ...Microsoft Visual StudioVB98 folder, but I want to create the file in the same folder that holds my project, and in the future my standalone exe. I don't understand the path expression, so could any one enlighten me on this?
Thanks a lot in advance.

Help W/ Sequential Access File && Menu Control
scenario: computer warehouse wants an application that will calculate both the total number of items sold and the total number sold by item. the application should allow the user to print the interface.

this is what i have done. dont know where to start now.


Code:
Option Explicit

Private Sub Form_Load()
frmComputer.Top = (Screen.Height - frmComputer.Height) / 2
frmComputer.Left = (Screen.Width - frmComputer.Width) / 2
lstItem.AddItem "ABC11"
lstItem.AddItem "CVA33"
lstItem.AddItem "BDX22"

lstItem.ListIndex = 0

End Sub


Private Sub mnuFileExit_Click()
Unload frmComputer
End Sub

the book says:
code the calculate total option so that it calculates the total sold, from the lc5.dat file (its on my disk). display an apporopriate message along with the total number sold in the lblTotall control. (For example, display the message "The total number sold is 300" in the lblTotal control.

this is whats in the lc5.dat file:
"BDX22",100
"ABC11",150
"BDX22",250
"CVA33",100
"ABC11",300

i dont know what to do. help please

Length Of Sequential Access (text) File
Anyone want to give me a quick way to find the length (in lines) of these types of files?

Thanks!!!!

Fill A Listbox From A Sequential Access File
Greetings,

I've got a sequential access file (capital.dat) which has two fields. first is the name of a state and the second is the capital of that state. Needless to say there are 50 states.

I want to fill a listbox (lstStates) from the first field (the one with the states) from a sequential access file...

Open "a: ut10capital.dat" For Input As #1

Do While Not EOF(1)
lstState.AddItem intCapitalArray ' obviously wrong
Input #1, intCapitalArray(intNum) ' again... wrong
Loop
Close #1


What code should I use? Thanks....

Stephen

How Do You Record Information In A Sequential Access File?
i have a program that allows the user to enter the inventory number, quantity, and price of an item in an interface and i need to know how to save this information in a sequential access file named Boggs.dat. Any help would be appreciated.

Randomize Input From A Sequential Access File
For a number of itterations (perhaps twice the size of the array),
randomly choose two indexes to swap.

Similar to this


VB Code:
Dim index1 As IntegerDim index2 As IntegerDim count As IntegerDim strTemp As String For count = 1 To 1000   ' This is assuming a 100 element array of list1 & list2   ' This will get a number between 1 and 50   index1 = Int(Rnd() * 50) + 1   ' This will get a number between 51 & 100   index2 = Int(Rnd() * 50) + 51      strTemp = Me.List1(index1)   Me.List1(index1) = Me.List1(index2)   Me.List1(index2) = strTemp    strTemp = Me.List2(index1)   Me.List2(index1) = Me.List2(index2)   Me.List2(index2) = strTemp Next count

Converting From Sequential To Random Using An Access Database
Ok, here's my migraine, I've done the coding to this application to access sequential files, I'm further down the road on my course and I have been given a pre-designed access database incorporating all the sequential .DAT files, I've gone through my books and over examples and I still can't grasp the conversion process. Does anyone know of any sites out there that might be able to help me? or maybe a tutorial? I could even attach the files (its a small app) if that might benefit me. I just desperately need understanding on converting all the WRITE, READ, INPUT into ADO style commands.


Thank you
Mav49

Sequential Access Files: Reading/search Coding
I am working on an employee program. I have a txt file to include the employees but when i do a search it comes back as nothing found. I did a debug and when the case comes to [example] name it go directly to the next case. Why is my file not being displayed in the fields?? Please help. Here is the code. The txt file has for example: "mikey Mouse"; "walt Disney";"207-785-8585"; "12"


VB Code:
Private Sub cmdSearch_Click()Dim strQuery As String, strSearch As String Do While (strQuery <> "NAME") And (strQuery <> "ADDRESS") And (strQuery <> "PHONE") And (strQuery <> "NUMBER")strQuery = UCase(InputBox("What do you want to search on Name, Address, Phone or Number?"))LoopstrQuery = UCase(InputBox("ENTER " & strQuery & "OF EMPLOYEE TO SEARCH FOR:"))strSearch = strQuerySelect Case strQuery    Case "NAME"    Open strFName For Input As #1 'opens file with employees listed        Do While Not EOF(1)        Input #1, strEmpName, strAddress, strPhone, intEmployeeNumber 'reads record on file            If strSearch = strEmpName Then            lblName.Caption = strEmpName            lblAddress.Caption = strAddress            lblPhone.Caption = strPhone            lblNumber.Caption = intEmployeeNumber            End If        Loop    Case "ADDRESS"        Open strFName For Input As #1        Do While Not EOF(1)        Input #1, strEmpName, strAddress, strPhone, intEmployeeNumber            If strSearch = strAddress Then            lblName.Caption = strEmpName            lblAddress.Caption = strAddress            lblPhone.Caption = strPhone            lblNumber.Caption = intEmployeeNumber            End If        Loop    Case "PHONE"        Open strFName For Input As #1        Do While Not EOF(1)        Input #1, strEmpName, strAddress, strPhone, intEmployeeNumber            If strSearch = strPhone Then            lblName.Caption = strEmpName            lblAddress.Caption = strAddress            lblPhone.Caption = strPhone            lblNumber.Caption = intEmployeeNumber            End If        Loop    Case "NUMBER"        Open strFName For Input As #1        Do While Not EOF(1)        Input #1, strEmpName, strAddress, strPhone, intEmployeeNumber            If Val(strSearch) = intEmployeeNumber Then            lblName.Caption = strEmpName            lblAddress.Caption = strAddress            lblPhone.Caption = strPhone            lblNumber.Caption = intEmployeeNumber            End If        Loop    End Select    If lblName.Caption = "" Then        lblName.Caption = "None Found"    Close #1    End IfEnd Sub

List Box, Instr Function, And Sequential Access File
This is an exercise from my book I have to do. I am stumped on it and don't know where to start.

The main program design has one list box on the left and one on the right. The list box on the left has full-time, full-time/new cars, full-time/used cars, new cars, part-time, part-time/new cars, part-time/used cars, and used cars in it. When you click on one of this it is supposed to list the names of these employees in the list box on the right. The names of the employees are located in a .dat file along with F1, F2, P1, P2 next to there names whether they are full-time (F), New Cars (1), Part-time (P), Used Cars (2). The first list box is named lstChoices, the second one is lstNames and I'm supposed to code lstChoices click event so that it displays the appropriate listing in the lstNames list box (Hint: Use the Instr function). This is all the information I have. The items are already added to the first list box, so I'm stuck beyond this point. Any advice would be appreciated, or if something like this has been posted before please tell me where I can find it. Thanks.

BTW, I'm using VB 6.0

DJ2005

Problem With Simple Sequential Access Data Base File
I'm working on a Calculator App and the link before is to one of the forms on it. The form is the Registration form. It's accessed via the menu from the Calculator App but this is only that specific part of the App. I'm really bad with Sequential Access Files and I can't seem to get this to work right. What I want it to do is to store the Name of the Person and the Company in a Sequential Access File so that the next time someone looks as this window even after they have quit the App the name and company will be there untill they change it something else. For some reason it keeps telling me it's past the end of the file when I'm in input mode but shouldn't input mode put the record reader at the begining of the file? If you could download the file below and take a look at it I would be eternally greatful.

http://homepage.mac.com/skamen/.cv/s...n.frm-link.frm

Thanks again,

-Scott

Reading/Writing Large Sequential Access Files - Error
OK here's the gist:

My colleague has written some code that reads from two files, makes a few comparisons, and writes to one of three new files.

The problem is file size; when the program is reading files under a meg, there's no problem. When the file size increases, however, Access (yes, it's VBA; no VB available at client) stops responding.

The really odd behavior is that Access is halting while printing/writing a variable name; i.e. it gets through X characters in the variable name and quits responding.

We've duplicated the error on two machines with different specifications, and it hangs in the same place.

Any ideas? Are there known issues with writing/reading large files?

Opening A Sequential File For Read Access In Shared Mode
Does anyone know if there is a way to open a sequential file for
reading (Output) in a way that the file could be opened for
other processes at the same time for reading. Using either the
File System Object or the older Open "C:MyFile.txt" For Output
As #MyFileHandle approach.

Here's a little context.

I am writing a VB6 program that needs to be able to open up a
text file read a specified number of records and Insert them
into a database. The file is quite large and we would like to be
able to run muliple instanses of this loader program. Either
from one server or from multiple servers while accessing the
same input file. For instance... the first instance of the
program would open the input file and read the first 20000
records inserting them into the database. At the same time a
second instance of the same program would be launced adn it
would read records 20001 through 40000 and intert them into the
database through a separate DB connection.

I must admit I haven't simply tried doing it concurrently using
either the FSO or the older approach so I don't know if it opens
the input file for shared access already.

Thanks for any assistance,
Doug

Writing To A "Sequential Access File" && Printing A Report
Can someone please take a look at my code and get me back on track here is what I'm trying to accomplish.

I want an application that will allow the user to enter the inventory number, quantity, and price of each item in inventory. The application should allow the user to record this information in a sequential access file named la3.dat

In addition, the application should allow the user to print a report showing the inventory number, quantity, and price of each inventory item, as well as the average price.

Inventory NumberQuantityItem Price
ABC12 10010.50
XYZ35 50 15.99
KLK25 15020.00

Here is what I have thus far for the printing the report:

VB Code:
Private Sub cmdPrint_Click()    Dim strIN As String, intQty As Integer, intIP As Integer, intAvg As Integer    Dim strFont As String, sngSize As Single    Dim strPS1 As String * 5, strPS2 As String * 3, strPS3 As String * 5                strFont = Printer.Font          'save current printer settings    sngSize = Printer.FontSize    Printer.Font = "courier new"    'change printer settings    Printer.FontSize = 10           'print title and headings    Printer.Print Tab(30); "Boggs Inc.Inventory Report"    Printer.Print    Printer.Print Tab(5); "Inventory Number"; Tab(25); "Quatity"; Tab(37); "Item Price"End Sub


Please Help

Random Or Sequential??
Hi there,
My program writes a list of URL's to a file and then retrieves them every time my program starts. My program then populates the URL's into a listbox.

Am I best using random or sequential file access??

Many thanks

Jordan

Sequential Files Help
is there a way to not have an extra line of blankness under what you just printed into a sequential file?

Sequential Files
I have to do an assignment that requires me to make a form and put the info gathered into two sequential files. I am clueless as to what this even is. Is there a tutorial that will expain what the whole process is?

Combobox And Sequential
could any of you fine people give me a quick example on using a combobox with sequential.
if i use this to open the file with a textbox, what do you changeadd for a combobox

Code:
Open "c: est.txt" For Input As #1
Text1.Text = Input$(LOF(1), 1)
Close #1

and if i use this to save to file with a textbox, what do you changeadd for a combobox

Code:
Open "c: est.txt" For Output As #1
Print #1, Text1.Text
Close #1

never really used sequential before, its time i did.

btw: its not homework, i dont go to college just incase you was thinking that.

thanks
thingimijig.

Sequential Tutorial
could anybody point me in the right direction to a good tutorial on doing a sequential data file.

thanks.

thingimijig.

Sequential Files
Is there a special way to open a sequential file if the file isn't located on your hard, but on the web?

I tried the Open "actual address here" For Input As #1

and it gave me "Path Not Found"

How do I load a sequential file stored on the web?

Sequential Files
Is there a way to make a program figure out how many items are in a sequential file?

Sequential File I/O
Hi !

Im fairly new to VB6.0 and have only programmed using ADO connections to a Database. I have done a very small amount regarding Sequential I/O.

I Now Have a need to Read in a Sequential File, Reformat various Information and Output the data to a new Sequential File, delete the original and rename the New file to the Original Name.

Whats the most effecient way of Reading and Writing SequentiAL iNFORMATION. ?

Should I use the Scripting Library ?
Should I use Streams (not sure what this entails) ?
Should I Just Stick to the Input and Print Statements ?

Whats the Best way to Format a String, Ensuring Information is Present at Specific Offsets within the Output.


Thanks in Anticipation

Sequential File
Hi -
I have a tic tac toe programme, but want to use a txt file to write/read data to and from it, the data would simply be, "This programme was last accessed on..........DATE"
So only the date needs to be stored, and when its ran again it needs to clear the txt file and put in the new date.
Not really sure how to do this, can any help me?

Thank you

Need Help With Sequential Files
I need a program that is used to store data produced by a trucking fleet. The program is used to enter truck number, miles driven, and gallons of fuel . The trucking company runs this program weekly, but the data is only analyzed quarterly. The program should open the file in Append mode so that the data will be added to the end of an existing file. If the file does not exist, it should be created. I need to use the Open dialog box because the company may want to access the data with a spreadsheet program, the file format would be CSV. If any one could help me with this I would be much in your debt!!!!!!!

Thanks,
Jason


P.S. The visual basic version i am using is 6.0

Sequential Files
Hello

I'm working on a project that requires us to read one name off a sequential file. My idea is to type a last name into an input box and then to display it on the screen in all the right fields. The problem is that I have a dountil eof loop going and it keeps looping past the Last name I typed in. I tried debugging tool and it showed me that it is looping past the name I tried. What am I doing wrong?

Copyright © 2005-08 www.BigResource.com, All rights reserved