-
Jul 9th, 2021, 03:13 PM
#1
Thread Starter
New Member
VB6 Won't Update mdb database
VB6 app developed on Win XP with DAO 3.6. Compiles and runs in XP with
the db updating correctly. When app.exe file is copied to and run
in Windows server 2012, the app runs and sees the incoming data but will not
write to the mdb database. Any ideas?? Thanks.
-
Jul 9th, 2021, 07:36 PM
#2
Re: VB6 Won't Update mdb database
Depends what you mean by, will not write to the mdb database. What happens? Nothing, throws an error.....
Also, posting the code that write to the db would be helpful.
-
Jul 9th, 2021, 08:33 PM
#3
Thread Starter
New Member
Re: VB6 Won't Update mdb database
OK Some more info:
The runtime runs on the server 2012 and the field values can be seen updating. The database exists
on that server but the record never updates.
Dim DBASE As Database
Dim SYS1 As Recordset
Set DBASE = OpenDatabase("\\b0254S25\MONITOR\rtdata_2003_Backup.mdb", False, False)
Set SYS1 = DBASE.OpenRecordset("SYSTEM", dbOpenTable, dbSeeChanges, dbPessimistic)
SYS1.Edit
SYS1(1) = Year(Date)
SYS1(2) = MONTH(Date)
SYS1(3) = Day(Date)
SYS1.Update
Microsoft DAO 3.6 library is referenced
-
Jul 10th, 2021, 01:51 AM
#4
Re: VB6 Won't Update mdb database
what record do you want to edit ?
the first
the last
Code:
Set SYS1 = DBASE.OpenRecordset("SYSTEM", dbOpenTable, dbSeeChanges, dbPessimistic)
SYS1.Edit
SYS1(1) = Year(Date)
SYS1(2) = MONTH(Date)
SYS1(3) = Day(Date)
SYS1.Update
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
-
Jul 10th, 2021, 09:26 AM
#5
Thread Starter
New Member
Re: VB6 Won't Update mdb database
SYSTEM is a single record in the SYS1 recordset. That record needs to be updated with the field values for SYS1(0), SYS!(1), etc.
-
Jul 12th, 2021, 01:34 AM
#6
Re: VB6 Won't Update mdb database
At a guess: Somewhere is an OERN masking the actual error (probably write-access rights)
EDIT: Just found something
dbSeeChanges 512 Generates a run-time error if another user is changing data you are editing (dynaset-type only).
Last edited by Zvoni; Jul 12th, 2021 at 01:39 AM.
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jul 12th, 2021, 06:23 AM
#7
Thread Starter
New Member
Re: VB6 Won't Update mdb database
Zvoni, Apologies but I don't know how to use the info you offered.
-
Jul 12th, 2021, 06:48 AM
#8
Re: VB6 Won't Update mdb database
Do you have an On Error Resume Next beforehand?
Since you said it worked on XP, but not on 2012 i'm guessing write-access issues with the folder the mdb-file is placed in
Check your rights on that particular Share and/or your rights for the mdb-file itself. You need write-access to the folder/file itself
You're using dbOpenTable, but dbSeeChanges only makes sense with dbOpenDynaset
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jul 13th, 2021, 07:05 AM
#9
Thread Starter
New Member
Re: VB6 Won't Update mdb database
Zvoni, The db is not write protected. I believe the issue is with which version of msaccess is at play. We have a parallel application running on the server which was developed on the same WinXP laptop which writes into its own db. Any thoughts on DAO vs. ADO that might have changed? Both databases can be opened in Access and report as "Access 2002-2003 file format".
-
Jul 13th, 2021, 07:12 AM
#10
Re: VB6 Won't Update mdb database
I wasn't talking about write-protected (in this Property-Tab of the File-Properties)
I'm talking about access-rights to the Folder/File (In that Property-Window on Tab Security or whatever it's called): You need write-access there.
I don't think it's the version of access installed, since your app is written in VB6, and you connect to the Database using the Jet-Engine (DAO)
DAO vs. ADO: DAO is dead. Use ADO
Another thought: Maybe updating/converting from mdb to accdb but since the last time i used an access-database is some 20 years ago, i'll leave that can of worms to others.
There might be issues with different Access-runtimes i have no clue about
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jul 13th, 2021, 08:54 AM
#11
Lively Member
Re: VB6 Won't Update mdb database
Originally Posted by bgiffow
Zvoni, The db is not write protected. I believe the issue is with which version of msaccess is at play. We have a parallel application running on the server which was developed on the same WinXP laptop which writes into its own db. Any thoughts on DAO vs. ADO that might have changed? Both databases can be opened in Access and report as "Access 2002-2003 file format".
Instead of dbOpenTable use dbOpenDynaset
https://docs.microsoft.com/en-us/off...numeration-dao
-
Jul 13th, 2021, 09:00 AM
#12
Re: VB6 Won't Update mdb database
Originally Posted by LeoFar
Leo, doesn't explain his statement, why it worked on XP, since his client is written in VB6.
What i just noticed: He said that he moved the app to the server, too, and that it runs there.
My Question is: Is it really running ON the server (as in process-space), or does someone use a link to the app from a client-computer?
Because in that case, the app would run in the process-space of the client-computer, not on the server, and there might be issues with runtimes installed locally
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jul 13th, 2021, 09:31 AM
#13
Thread Starter
New Member
Re: VB6 Won't Update mdb database
To confirm: the app.exe was copied to the server and runs there.
-
Jul 13th, 2021, 03:15 PM
#14
Lively Member
Re: VB6 Won't Update mdb database
Originally Posted by bgiffow
To confirm: the app.exe was copied to the server and runs there.
The app is always run on the client computer that launches it (locally), no matter where the exe is located.
-
Jul 13th, 2021, 03:24 PM
#15
Thread Starter
New Member
Re: VB6 Won't Update mdb database
That's what I was trying to say. The app.exe and its database are on the server. We log into the server and launch the app from there. The server has no access to the laptop that generated the runtime.
-
Jul 13th, 2021, 03:47 PM
#16
Lively Member
Re: VB6 Won't Update mdb database
Originally Posted by bgiffow
That's what I was trying to say. The app.exe and its database are on the server. We log into the server and launch the app from there. The server has no access to the laptop that generated the runtime.
All business programs work like this, unless the program is structured in two distinct parts: a Client and a Server.
-
Jul 14th, 2021, 01:22 AM
#17
Re: VB6 Won't Update mdb database
OK, the only thing left:
Please test on the server moving the App and mdb-file to a another (public?) folder, where access-rights are on "full access" (or whatever it's called), and test there.
If it doesn't run it's a machine-problem, if it runs, then it's the folder where the mdb-file is located
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jul 20th, 2021, 02:21 PM
#18
Thread Starter
New Member
Re: VB6 Won't Update mdb database
OK. The complete package was prepared from the development code. The package, a copy of the database and the app.exe were all copied to a separate computer running Win 10. The setup.exe for the package was run and installed successfully. The data collection portion of the program is working correctly but the database is not being updated. This continues to smell like an msaccess problem.
-
Jul 20th, 2021, 08:52 PM
#19
Re: VB6 Won't Update mdb database
Originally Posted by bgiffow
This continues to smell like an msaccess problem.
I hope you have a good rhinologist.
It seems unlikely to me that Access is the culprit. I don't believe you've ever addressed the questions about any error handling in your code, specifically involving methods that interact with the database. If you are suppressing any errors, either via On Error Resume Next, or having a blank Error handler routine, then you should be commenting out the "On Error" lines of code, let any potential errors be thrown, and see what they are. That would be the first breadcrumb towards resolution.
Also, I'm assuming you've verified this, but have you tried to browse to the exact UNC path that the database file is located on (referenced in post 3 above) while logged in to this server as this user? And verified that this user account has read/write/modify capabilities with content in that UNC path?
-
Jul 21st, 2021, 06:07 AM
#20
Thread Starter
New Member
Re: VB6 Won't Update mdb database
I will continue down that path. Now if coworkers will leave me alone for a bit, I'll get focused.
-
Jul 24th, 2021, 03:13 AM
#21
Re: VB6 Won't Update mdb database
the first thing that comes to my mind is: windows folder redirection (whats the damn correct name of this? forgot..). i.e. you cant write to the program folder and others but you get silently redirected to other folders. so you may not use the mdb file you intended to...
-
Jul 24th, 2021, 08:00 AM
#22
Re: VB6 Won't Update mdb database
you can test save recordset in server pc :b0254S25
and make a winsock control for send cmd by other computer.
Just like the server itself has installed N types of databases, the client only needs to open the web page to read and write the database, realizing the separation of front-end and back-end
-
Jul 24th, 2021, 08:03 AM
#23
Re: VB6 Won't Update mdb database
The unit I worked in last year forced the use of ACCESS to read and write databases on the LAN. It took 200 seconds to connect successfully, which was often unstable. It only takes 200 milliseconds to connect to SQL SERVER. Therefore, it is the correct way to use a TCP type network database for communication between multiple computers. Otherwise, if the server database MDB has 200M, it also needs to be read out and then modified. The hard disk io pressure is very high and it is easy to damage the database. , Reading and writing are also very slow.
-
Jul 24th, 2021, 08:05 AM
#24
Re: VB6 Won't Update mdb database
Running the compiled EXE directly, running on different operating systems will also cause errors or inconsistent results. You can install VB6 directly on SERVER 2012 and try it directly with the source code, and then compile it into EXE
-
Jul 26th, 2021, 07:24 AM
#25
Thread Starter
New Member
Re: VB6 Won't Update mdb database
OK Folks. This topic is on hold for the moment while I get thru the error tracing per OptionBase1 above. Thanks.
-
Aug 6th, 2021, 03:40 PM
#26
Thread Starter
New Member
Re: VB6 Won't Update mdb database
Problm resolved! I'm no expert but the following allowed a VB6 application
to write to an access database residing on a R2012 server along with the application
executable. The application development was done on Win XP due to old proprietary
controls. The issue turned out to be mismatched references in the database when it
was migrated to the server. In particular, the Microsoft Access 16.0 Object Library
did not like my VB6 executable.
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
|