Modules & VBA :: How To Create New Lock File Within Current Database
Apr 7, 2015
What I'd like to do is have an "export button", where the OnClick event, exports a single table into a new accde file. This would allow the end users to zip this file up and send it to me.
Because of all sorts of stupidity, I have no network capability and must send data back and forth via email.
I have digressed to a replication table that needs to be uploaded, once data is entered by the users...
Because the files can get relatively large (for emailing purposes), I am trying to figure out how I can get just one table from them vs. sending the whole application file back to me... It's pretty vital that they not be able to edit the table because that could really mess up the process.
So any way to create a new lock file from within the current Db?
View Replies
ADVERTISEMENT
Feb 26, 2006
Hi there, we currently have a database that users write to through an excel form. Each time a user sumbits a record to the database we open a connection up with the below code, insert the record and then close it. This creates a ldb file for 1-3 seconds depending on how long it takes.
' OPEN DATABASE CONNECTION
Set dbConn = New ADODB.Connection
dbConn.CursorLocation = adUseClient
dbConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0"
dbConn.Open sConn
' INSERT RECORD THROUGH EXECUTE COMMAND
dbConn.Execute("INSERT INTO.... VALUES....")
' CLOSE CONNECTION
dbConn.Close
Is it possible to open the connection up without an ldb file being created so more than 1 user can insert a record into the database at the same time?
Thanks for your time,
Cheers
Tony
View 6 Replies
View Related
Oct 20, 2014
I have a DB with multiple import processes to take in information and populate various tables. This has been in place for some time and works with no issue.
The import process involves the creation of a local staging table, to which I import the received data, normalise it according to my own table structure, remove any duplication (i.e. same data imported repeatedly) and append the cleansed data to the main tables.
I've just added a validation step to check for data integrity. In other words, for duplicate data, rather than simply purge it as I was doing previously, I now check to see if the data has changed in any way and prompt the user if necessary (with the option to either ignore the change or update the existing record)
However, since I added this extra step, I am getting the following error message during my import process :
Error 3211 : The database engine could not lock table 'tblStaging' because it is already in use by another person or process
It only appears a) when a data change is detected and b) when the option to update is chosen, and seems to occur after the update has taken place (i.e. I can see the records suitably updated)
But I can't replicate the error while debugging so it seems to be a run-time issue. It's definitely not another user as the staging table is deliberately local (specific to that user's front-end)
I suspect I can probably solve the problem by adding some kind of DoEvents call or brief pause somewhere but the problem is, I don't know where the problem is occuring, so I don't know where to add the line? Or if that would even solve the problem at all?
Is there an easy function I can call to check if the staging table is locked? Which I could then use to debug and identify exactly where the lock is causing a problem? Or even apply the DoEvents to release the lock? (It must eventually get released as if I step through the code, I don't get the error?)
View 5 Replies
View Related
Mar 3, 2012
An ancient application I'm working with came with .ini file which looks like an instruction set to create an access database. A sample few lines look like:
TABLE, USER, 13
FIELD,USRID,LONG,2,NODUP,ID,False,0,AUTO
FIELD,USRFNAME,TEXT, 50, NO, , True, 1
TABLE,VISITS,15
FIELD,VISIT,TEXT,12,NODUP, ID,False, 0
and so on.
Is there a way to get Access (2007 in my case) to create a new db by reading from this file? Or do I need to manually enter all this information.
View 1 Replies
View Related
Nov 29, 2005
Hi all!
This is my first post here so my appologies if I do something wrong AND my terrible English!! :cool:
I have made a database in Access where I can store all kind of information about hardware (laptop type, s/n, hdd size, memory etc.). Now it sometimes happens that an engineer will loose (!!) his laptop or it wil be stolen...
I want to build an option to mark the current record (of that stolen laptop) as stolen. Just with a checkbox. When i select the checkbox "stolen", all fields in the form of the current record has to be greyed-out. But just only for that record.
Is this possible?
Thanks in advance!
Kindest regards,
Tim
View 14 Replies
View Related
Sep 13, 2013
I would like to read a TIFfle to ACCESS, and store its content as hexadecimal like below to further other process..., how can I achieve this change and storage??
0000: 49 49 2A 00 4E 00 00 00 80 3F E0 50 38 24 16 0D
0010: 07 84 42 61 50 B8 64 36 1D 0F 88 44 62 51 38 A4
0020: 56 2D 17 8C 46 63 51 B8 E4 76 3D 1F 90 48 64 52
0030: 39 24 96 4D 18 80 80 00 60 00 00 00 01 00 00 00
0040: 60 00 00 00 01 00 00 00 08 00 08 00 08 00 0F 00
0050: FE 00 04 00 01 00 00 00 00 00 00 00 00 01 03 00
0060: 01 00 00 00 11 00 00 00 01 01 03 00 01 00 00 00
0070: 0F 00 00 00 02 01 03 00 03 00 00 00 48 00 00 00
0080: 03 01 03 00 01 00 00 00 05 00 00 00 06 01 03 00
View 4 Replies
View Related
Nov 21, 2013
I have limited programming skills but a basic understanding of databases.I want to create a database in Access that links to contacts in an Outlook pst file, and in the Access database I want to create a series of date dependant tasks or processes that I can apply to the relevant contact.The object being to to save that collection of tasks to apply to different contacts within Access.
View 2 Replies
View Related
Nov 4, 2013
I'm trying to create a button that will open a save window so that user can select where and the name of a new backend file.
and create a new backend file from the one in use and link to the new open.
View 4 Replies
View Related
Jul 5, 2013
I have a spread sheet which on a per line basis contains columns whose cells contain the path to a file. It looks as if many of the files are tif, pdf, word and excel etc, so multiple file types.
Writing a routine which would take each row and then for each line of file paths turn them into one multi-page document - pdf or something?
View 1 Replies
View Related
Oct 22, 2014
I have a VBA routine that runs some queries and then creates a report as a PDF document using my virtual PDF printer. At this point it brings up the Save As dialog and I give the file a name and select a folder to store it in.
But I run this report 30 times for 30 different parameters. The parameters are obtained from a table which contains values such as Cancer, Diabetes, Stroke
-I always name the PDF file according to this value.
-I always choose the same folder.
-I always overwrite the reports I produced last month (copies have been sent elsewhere by then).
how can I get VBA to cycle through this code 30 times, each time selecting the next value from my table and creating/overwriting those files without the need for me to tell it the filename and path?
Code:
Private Sub lstSpecialties_DblClick(Cancel As Integer)
At the moment I am running this code by double-clicking an entry in the Specialty listbox, 'but I would prefer the whole thing to run multiple times for as many Specialties as exist in the table '(currently 30 but could be more in time)
'Warnings off
DoCmd.SetWarnings False
'Make the tables needed for the cumulative queries
DoCmd.OpenQuery "Spec 002 Monthly recruits - part 2 - make table" Each of these queries
DoCmd.OpenQuery "Spec 005 Monthly recruits - part 2 - make table" uses the Specialty selected above
DoCmd.OpenQuery "Spec 022 ABF previous year - part 2 - make table" as a parameter to get
DoCmd.OpenQuery "Spec 025 ABF current year - part 2 - make table" the right data for the report
[code]....
View 5 Replies
View Related
Apr 18, 2014
I have a folder which holds 1000s of pictures organised in subfolders, for example:
D:~AI Database Print Scans2009family and
D:~AI Database Print Scans2009holiday
And so forth. In total at the moment 17 main subfolders, each of which hold another 2-3 subfolders.
I am putting together a database to bring pictures together with all sorts of details. I import the picture via hyperlink and complete the various fields. All that works fine but there are a lot of pictures! And it gets confusing to see which ones have already been entered into the database and which ones haven’t.
One solution for this is to copy the pictures that have been “completed” to another folder. I have found a way to do that:
Dim fs As Object
Dim oldPath As String, newPath As String
oldPath = Forms!frmPrintDetails.txtPath1
newPath = "D:~AI Database Print ScansCompleted_Entries"
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile oldPath, newPath
Set fs = Nothing
Works fine, but the problem is that I loose the subfolder structure, it copies all pictures to the same main folder. I’d like to maintain the subfolder structure and add code to create the correct subfolders and next copy the picture. With the different paths I’m lost. I don’t know how to extract the correct path in code. I’d also like to either rename or remove the picture once I have completed entry of the details. The problem I have again is that I don’t know how to code for a changing path.
View 12 Replies
View Related
Jun 2, 2015
I want to create a Macro saves the report in a specific location, and uses two fields within the report to generate the name of the file. For example, "[Sales Rep Name] + [PayPeriod].pdf" and it should be saved in a predetermined folder.
View 1 Replies
View Related
Mar 16, 2015
I was wondering if it was possible to link random external tables to the Active Database through VBA. I would like to run the code that would open up a dialog box that would let the user select the database as well as the tables within that database that the user can select to link to. I am able to select the database and but not able to select the actual tables. The tables will be random so I can't make a constant statement for a specific database.
View 1 Replies
View Related
Apr 8, 2015
Code:
Function Write_rstADO_to_CurrdB_Table()
'Assumes you have already setup a DSN to your Server
'Assumes YOURDESTINATIONTABLE is the same structure as your SERVER.TABLE
Dim cnnADO As ADODB.Connection
Dim wkspDAO As DAO.Workspace
[Code] ....
View 1 Replies
View Related
Oct 24, 2014
I'm working on a database which is designed to connect to an app called Canvas (www dot gocanvas dot com). It's for a client which runs a team of heating engineers. All the information regarding the engineer's job is uploaded to Canvas through their API as an XML file, and the engineers use an app on tablet to view the job details. When the engineer goes to their customer and does some work, the completed info (which parts were serviced etc) is then downloaded as an XML file via the API into the database. Also, the customer signs on the engineer's tablet to confirm that the work has been done.
Although the XML files for the job data upload and download fine, there's a different API for getting a download of the JPEG which contains the customer signature, and I'm having real problems finding out how to use this.
The API guide says this:
----
The Submissions API is restricted to authenticated users and requires a username and apassword to access. In addition, the ID field is required. If these fields aren't specified, an error is returned.
The result of this webservice invocation will be either a standard JPEG image or an error code.
Example: [URL] ....
All my code (which I've pasted at the foot of this message seems to work fine. There are no errors, and the ResponseBody object appears to contain a byte stream which would be the jpeg... if only I could get it into a jpeg file!
How I go about taking this "stuff" that's come back in the responsebody and actually create a jpeg image file from it? I feel that I'm so close that I can smell it, but can't get the last step!
Here's the existing code :
Code:
Sub DownloadImageFile()
Dim xhr As Object
Dim webServiceURL As String
Dim actionType As String
Dim PostData As String
Dim strResult As String
[Code] ....
View 7 Replies
View Related
Sep 9, 2013
I am trying to create some code for a button in a report that will follow a hyperlink to a specific file. The problem I'm having is that the files that are at the end of the hyperlink can have various extensions (*.doc, *.docx, *.pdf, etc.) I'd like to be able to put a wildcard in the code to allow the opening of the file regardless of the extension.
Code so far:
Private Sub Command6_Click()
Application.FollowHyperlink ("C:UsersjbeggDocumentsAccessTestFolder" & [FileName] & ".*")
End Sub
View 11 Replies
View Related
Nov 1, 2004
I created a database for one company. So, this database needs to support multiple users environment. One of the users has problem opening the database. Sometime he can open it. . sometime he has an error message Could not lock file. Whats wrong with the database? (I gave him permission to Read, Write and Read & Execute)
Thanks in advance for all your answers.
View 1 Replies
View Related
Nov 30, 2005
Hi all,
We are changing domains and are doing alot of bouncing around with passwords and such.
Now all my users who are not in admins can not open our Db.
We get a message 'Could not lock file'. Any ideas?
thanks
View 3 Replies
View Related
Sep 26, 2006
Hi folks - need some help with what is probably very easy but I just can't get it.
I am running an access database on a 2 pc network with shared access etc. I can see all files on both computers but when I try to open the same file on both systems I get error message " could not lock file" I had another database earlier this year working on the two machines perfectly and was able to input data from both and the file was not a froint end back end structiure.
also if is any help the second machine only seems to be able to open in Read only mode. I have tried the user permission on the my computer allow shared access but this has not fixed it.
Any ideas much appreciated
Thanks
Humph
View 2 Replies
View Related
Jun 18, 2007
Hi,
We have manufacturing/shopping software that has an access backend. There is about 15 users access it via terminal services.
From what i know, access only allows for 256 connections, and that number can be viewed with the LDB Viewer.
The problem is that if someone doesn't log out, the database doesn't reset itself. The next day, the lock file will still be a high number, and the shopping software will have errors running reports.
I dont understand how this happens. If there only 15 users, how cant there be so many connections? What makes the count build up? What can i do besides kick everyone out to reset it?
thanks
View 3 Replies
View Related
Dec 19, 2006
In the lock file I noticed I can see the computer names of the people who have the db open. Is there a way to get the login names from this file so I can knock some sense in my co-workers who still have the database on
View 1 Replies
View Related
Jan 7, 2014
How to create backup for my table in another DB with VBA ....
View 3 Replies
View Related
Jul 11, 2007
I have a button in the form of the current access file. What I want to do is when the user click on the button,
triggered the vba to backup current access file. But since the file is currently open, is this possible? If yes, may I know how to do it with vba?
I have tried two methods but failed:
1) Use copytofile method, but I get permission denied due to file open;
2) Use dbengine.compactdatabase method, but it also has problem if the file is open.
View 3 Replies
View Related
Jul 27, 2005
Hi,
I have some code which updates an invoice table with transaction numbers. It worked ok until this month when we had to run three months worth of invoices in one go. I recieved a runtime error 3052 "File Sharing Lock Count Exceeded" and Access told me to increase the MaxLocksPerFile registry entry. I thought i'd better check it out a bit first though and found the following on support.microsoft.com
In Microsoft Access 2000, you can take advantage of a feature that allows you to increase the MaxLocksPerFile setting for Microsoft Jet database engine 4.0 by editing the Windows Registry. The default value of this setting is 9500. However, changing this value is not recommended if one of the replicas is located on a Novell Netware server, because the server's maximum record locks per connection is 10000.
The invoice table had about 20k lines but as I am on a netware server i'm not gonna be able to squeeze more than 10k lines out of my recordset so I was wondering if there is any way I can open it without record locking? The table that is being modified is never edited apart from in this one process so there is no risk of complications there.
Here is how I opened the recordset
Set rstInvs = dbs.OpenRecordset("SELECT [InvNumber], [InvNumExt], [TransactionType], [LineNum] FROM [tblInvoices]" _
& "WHERE [LineNum] Is Null ORDER BY [InvNumber], [InvNumExt], [TransactionType]")
Any help would be much appreciated.
thanks, Tom
View 14 Replies
View Related
Dec 20, 2013
I am looking to create a backup of a database on exit in a different directory then where I am storing the database now.
View 3 Replies
View Related
Sep 29, 2012
Trying to lock down an application by saving as ACCDE file. Saves OK but when you load application none of the controls work. I.e. button clicks do not launch "Open Form" or " Print Report" commands.But in ACCDB format application works flawlessly.
When I tried on a different machine I get an error message that says too many Table IDs. Odd since I only have 3 forms, 3 tables and 3 reports. Lots of DoCmd's and switching between the 3 forms but not sure why this would create "too many Table IDs"?
View 2 Replies
View Related