| | |
MS Access and other applications on VB6.0
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Hi! I have to problems regarding VB6.0 and Access and some other applications...
1. I can not open a database from access.
Dim mydb1 as Database
Dim myrs1 as Recordset
Set mydb1 = OpenDatabase("MyDatabase.mdb")
Set myrs1 = mydb1.OpenRecordset("student")
The error appears on the bold text.
It says either "Unrecognized database format..." or "Couldn't find file..."
I am sure that I typed the filename properly, that it is located in the same folder as my program/project and that it is created in MS Access.
2. I can not open an application using VB6.0
My code is simply
Private Sub CmdGo_Click()
Shell Text1.Text, vbNormalFocus
End Sub
The user types the path and the program runs it. The program works for all applications except one. There is a bot program in this PC and it doesn't seem to run/load when I use my VB program. The window pops for a second and then disappears. Are there limitations to which kinds/types of programs/applications VB can open/run/load? Hope you can help me. Thanks!
1. I can not open a database from access.
Dim mydb1 as Database
Dim myrs1 as Recordset
Set mydb1 = OpenDatabase("MyDatabase.mdb")
Set myrs1 = mydb1.OpenRecordset("student")
The error appears on the bold text.
It says either "Unrecognized database format..." or "Couldn't find file..."
I am sure that I typed the filename properly, that it is located in the same folder as my program/project and that it is created in MS Access.
2. I can not open an application using VB6.0
My code is simply
Private Sub CmdGo_Click()
Shell Text1.Text, vbNormalFocus
End Sub
The user types the path and the program runs it. The program works for all applications except one. There is a bot program in this PC and it doesn't seem to run/load when I use my VB program. The window pops for a second and then disappears. Are there limitations to which kinds/types of programs/applications VB can open/run/load? Hope you can help me. Thanks!
•
•
Join Date: Feb 2007
Posts: 4
Reputation:
Solved Threads: 0
well first you have to do is apply the references to Dao in the menu project -> references and selecting
Microsoft Dao 3.x Object Library then the code:
Dim MyDb1 as Dao.Database
Dim MyRs1 as Dao.Recordset
Set MyRs1 = Mydb1.OpenRecordset("student")
... well here the rest of your code for the query
then on the form load: (this is the first line runs so don`t forget, because this for open the database before to do the recordset!)
Set MyDb1 =OpenDatabase(App.path & "\MyDatabase.mdb")
remember save the project first and put the DB on the same diretory of your project , if you don't do `t no works because App.path get
C:\Archivos de programa\Microsoft Visual Studio\VB98 as default
am i guest your Bd is another place!
Microsoft Dao 3.x Object Library then the code:
Dim MyDb1 as Dao.Database
Dim MyRs1 as Dao.Recordset
Set MyRs1 = Mydb1.OpenRecordset("student")
... well here the rest of your code for the query
then on the form load: (this is the first line runs so don`t forget, because this for open the database before to do the recordset!)
Set MyDb1 =OpenDatabase(App.path & "\MyDatabase.mdb")
remember save the project first and put the DB on the same diretory of your project , if you don't do `t no works because App.path get
C:\Archivos de programa\Microsoft Visual Studio\VB98 as default
am i guest your Bd is another place!
![]() |
Similar Threads
- MS Access vs. MySQL (MS Access and FileMaker Pro)
- Is it possible to display report in Visual Basic which is created in Microsoft Access (Visual Basic 4 / 5 / 6)
- VB6 Access error Please Please Help !!! (Visual Basic 4 / 5 / 6)
- I'm connected but cant access any sites or email (Web Browsers)
- create a query in access from vb6 (Visual Basic 4 / 5 / 6)
- How can i access Time from Server ? (Visual Basic 4 / 5 / 6)
- access (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Writing function results
- Next Thread: Create accounts
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





