|
-
Jun 2nd, 2000, 01:11 AM
#1
Thread Starter
Junior Member
First look at this thread
http://forums.vb-world.net/showthrea...threadid=18310
It was my fault to say at the end
I got it all squared away now.
There are more problems...
I installed Ms-Access on the computer and found the program that makes workgroups - I made my own .mdw file, too.
But now, every time I try to run my program, I get the run-time error '3049', which says "Can't open database ''. It may not be a database that your application recognizes, or the file may be corrupt."
Does anyone know how to get around this problem?
Please Help.
______
Bob K.
-
Jun 2nd, 2000, 05:27 AM
#2
Frenzied Member
Put up your code where you're opening your database (dummy up the user id and password, for your protection).
-
Jun 2nd, 2000, 06:09 AM
#3
Thread Starter
Junior Member
Sorry, What do you mean:
If you mean physically locate the code to be where I open the database, it is already there.
Otherwise, please explain further.
Thanks,
______
Bob K.
-
Jun 2nd, 2000, 06:32 AM
#4
What he means is that you should post your code so we can take a look at it.
-
Jun 2nd, 2000, 06:55 AM
#5
Frenzied Member
The only code, in this thread segment OR the other, was put up by JimBob:
DBEngine.SystemDB = "c:\windows\system\system.mdw"
Set ws = CreateWorkspace("Ticketing", "Admin", "", dbUseJet)
If I were you, after dbengine.systemdb I would add:
DBEngine.DefaultUser= "username" 'the user that has the authority to open the database
DBnEngine.DefaultPassword="" 'password for the above user
Then Open the database with:
Set ws=CreateWorkspace(C ath\database.mdb")
-
Jun 2nd, 2000, 10:23 PM
#6
Thread Starter
Junior Member
Marty: Thanks for the clarification. Here's the code I want to use
Code:
DBEngine.SystemDB = "C:\ServerProject\Server.mdw"
DBEngine.DefaultType = dbUseJet
Set UsrName = Workspaces(0).CreateUser("UserName", , "123456789")
Workspaces(0).Users.Append UsrName
Set WsNew = CreateWorkspace("SpecialWorkspace", "UserName", "123456789")
Workspaces.Append WsNew
Obviously, I had previously declared all those objects as the proper types.
I still get stupid error # 3049, though. I can't figure it out.
JHausmann: You can't use CreateWorkspace with a database name as the parameter. I did the other things you said, though, but I still get that error.
Any other suggestions? Am I writing the code wrong?
Please Help.
Thanks,
______
Bob K.
-
Jun 4th, 2000, 08:41 AM
#7
Frenzied Member
Sorry. You've got no code to open the database.
Instead of what you have
Use:
global gdbDbase as dao.database
'then in the subroutine
DBEngine.SystemDB = "c:\windows\system\system.mdw"
DBEngine.DefaultUser= "username" 'the user that has the authority to open the database
DBEngine.DefaultPassword="" 'password for the above user
Set gdbDbase=Workspaces(0).OpenDatabase(path\database.mdb")
Then, when you reference recordsets, to do the work, you preceed the command with the open database.
for example, to read all the records from a table you would do:
Dim rsTest as Recordset
set rsTest= gdbDbase.CreateSnapshot("select * from table")
(in ADO I would use:
SQLString="Select * from table"
Set rsTest = gdbDbase.OpenRecordset(SQLString, ))dbOpenSnapshot)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|