pls come inside.......先做一个access文件,save file as namelist.mdb
在里面做一个table, name as FriendInfo. table 里面设置7个column. name, age, address, handphone, workphone, homephone, numberForEntry....(这里假设你同学有3个号码)。 注意,把name, address设置成text; age, 电话号码都设成 number.
把这个mdb文件save到你的VB文件的文件夹里。
以上部分全部在access里面做好。
接下去在你的project里加一个module. click project-->add module. 然后把以下的codes加在里面,save.
Global CurDB As Database
Sub DbOpen()
Set CurDB = OpenDatabase(IIf(Right(App.Path, 1) = "\", App.Path & "namelist.mdb", App.Path & "\namelist.mdb"))
End Sub
Function Path() As String
Path = IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\")
End Function
Sub ErrorHandler(Err%, Module$, Action$)
'Error Handling Routine
Dim FNum
Dim FName
FNum = FreeFile
FName = Path() & App.EXEName & ".err"
Open FName For Append As FNum
Print #FNum, " Date/Time : " & Format(Now, "dd/mm/yyyy hh:nn:ss")
Print #FNum, " Module (more...)
多谢~~
不好意思的说, 可以把project发给我学习一下吗?
我的邮箱: musicsky2002@hotmail.com
Thanks again!