Click here to Skip to main content
16,014,294 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralMDI FORMS HELPPP! Pin
Josh1991186-Jun-05 8:21
Josh1991186-Jun-05 8:21 
GeneralRe: MDI FORMS HELPPP! Pin
Rizwan Bashir6-Jun-05 22:12
Rizwan Bashir6-Jun-05 22:12 
GeneralRe: MDI FORMS HELPPP! Pin
Anonymous7-Jun-05 2:31
Anonymous7-Jun-05 2:31 
GeneralSudden crash Pin
vishalmishra6-Jun-05 7:51
vishalmishra6-Jun-05 7:51 
GeneralRe: Sudden crash Pin
Christian Graus6-Jun-05 14:17
protectorChristian Graus6-Jun-05 14:17 
GeneralAxtivex controls Pin
smita_roy6-Jun-05 3:09
smita_roy6-Jun-05 3:09 
GeneralRe: Axtivex controls Pin
Rizwan Bashir6-Jun-05 3:29
Rizwan Bashir6-Jun-05 3:29 
Generalrandom files..... Pin
virtual_manu6-Jun-05 1:32
virtual_manu6-Jun-05 1:32 
i am working with vb.net and want to create a random file. the file should not be fixed size......helpme .... ByVal e As System.EventArgs) Handles Button6.Click
Dim Employee As Person
FileNum = FreeFile()
FileOpen(FileNum, TextBox1.Text, OpenMode.Random, , , Len(Employee))
Do While Not EOF(FileNum)
FileGet(FileNum, Employee, )
If Employee.ID = Val(TextBox5.Text) Then
Position = Loc(FileNum)
TextBox5.Enabled = False
TextBox6.Enabled = True
TextBox7.Enabled = True
Button5.Enabled = True
Button6.Enabled = False
Button7.Enabled = True
TextBox6.Text = Employee.Name
TextBox7.Text = Employee.Surname
Exit Do
End If
Loop
FileClose(FileNum)
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim Employee As Person
FileNum = FreeFile()
FileOpen(FileNum, TextBox1.Text, OpenMode.Random, , , Len(Employee))
Seek(FileNum, Position)
Employee.ID = Val(TextBox5.Text)
Employee.Name = TextBox6.Text
Employee.Surname = TextBox7.Text
FilePut(FileNum, Employee, )
FileClose(FileNum)

TextBox5.Enabled = True
TextBox6.Enabled = False
TextBox7.Enabled = False
Button5.Enabled = False
Button6.Enabled = True
Button7.Enabled = False
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""

End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Dim Employee As Person, FileNum1, FileNum2 As Integer
FileNum1 = FreeFile()
FileOpen(FileNum1, TextBox1.Text, OpenMode.Random, OpenAccess.Read, , Len(Employee))
FileNum2 = FreeFile()
FileOpen(FileNum2, "abcdefg.tnt", OpenMode.Random, OpenAccess.Write, , Len(Employee))

Do While Not EOF(FileNum1)
If (Loc(FileNum1) <> Position - 1) Then
FileGet(FileNum1, Employee, )
FilePut(FileNum2, Employee, )
Else
FileGet(FileNum1, Employee, )
End If
Loop

FileClose(FileNum1)
FileClose(FileNum2)

Kill(TextBox1.Text)
Rename("abcdefg.tnt", TextBox1.Text)

TextBox5.Enabled = True
TextBox6.Enabled = False
TextBox7.Enabled = False
Button5.Enabled = False
Button6.Enabled = True
Button7.Enabled = False
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
End Sub

End Class

after inserting few records in file ....new data is not being taken....
GeneralRe: random files..... Pin
toxcct6-Jun-05 1:48
toxcct6-Jun-05 1:48 
GeneralRe: random files..... Pin
Rizwan Bashir6-Jun-05 3:33
Rizwan Bashir6-Jun-05 3:33 
GeneralRe: random files..... Pin
virtual_manu7-Jun-05 5:14
virtual_manu7-Jun-05 5:14 
GeneralRe: random files..... Pin
Rizwan Bashir7-Jun-05 22:54
Rizwan Bashir7-Jun-05 22:54 
GeneralRegisteration of DLL Pin
Gagan Deep Singla6-Jun-05 0:53
Gagan Deep Singla6-Jun-05 0:53 
GeneralRe: Registeration of DLL Pin
enesaga1236-Jun-05 1:28
enesaga1236-Jun-05 1:28 
GeneralRe: Registeration of DLL Pin
enesaga1236-Jun-05 1:32
enesaga1236-Jun-05 1:32 
GeneralRe: Registeration of DLL Pin
MohammadAmiry6-Jun-05 2:24
MohammadAmiry6-Jun-05 2:24 
GeneralDirectoryServices Pin
nitin_ion6-Jun-05 0:22
nitin_ion6-Jun-05 0:22 
GeneralCrystal Report Formula Editor Pin
LordLothar5-Jun-05 23:11
LordLothar5-Jun-05 23:11 
GeneralRe: Crystal Report Formula Editor Pin
Yulianto.5-Jun-05 23:55
Yulianto.5-Jun-05 23:55 
GeneralRe: Crystal Report Formula Editor Pin
LordLothar6-Jun-05 2:06
LordLothar6-Jun-05 2:06 
GeneralRe: Crystal Report Formula Editor Pin
Yulianto.6-Jun-05 16:10
Yulianto.6-Jun-05 16:10 
Generalcrystal report help regarding jpeg image Pin
kar arnab5-Jun-05 22:24
kar arnab5-Jun-05 22:24 
Generalrun in LAN Pin
daneshmand5-Jun-05 22:00
daneshmand5-Jun-05 22:00 
GeneralRe: run in LAN Pin
Rizwan Bashir5-Jun-05 22:07
Rizwan Bashir5-Jun-05 22:07 
GeneralRe: run in LAN Pin
Yulianto.5-Jun-05 23:11
Yulianto.5-Jun-05 23:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.