Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,458 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,874 people online right now. Registration is fast and FREE... Join Now!




VB Code

 
Reply to this topicStart new topic

VB Code, To connect a database in MS Access and open a document in wordpad form

karlamohan
26 Jul, 2008 - 04:25 AM
Post #1

New D.I.C Head
*

Joined: 26 Jul, 2008
Posts: 1


My Contributions
vb

Private Sub Command1_Click()
'Get a free file number
nFileNum = FreeFile
'Open a text file for input. inputbox returns the path to read the file
Open ("C:\Program Files\Microsoft Visual Studio\VB98\bioemp\") For Random As Text1.Text
lLineCount = 1
'Read the contents of the file
Do While Not EOF(nFileNum)
Line Input #nFileNum, sNextLine
'do something with it
'add line numbers to it, in this case!
sNextLine = sNextLine & vbCrLf
sText = sText & sNextLine
Loop
Text1.Text = sText
Close nFileNum
End Sub


## Run time error 13

type mismatch

Mod Edit: Please use code tags when posting your code. Code tags are used like so => code.gif

Thanks,
PsychoCoder smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 03:48PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month