Modules & VBA :: Read XML File Which Needs To Be Processed In Access Database

Oct 8, 2013

For weeks I am trying to read an XML file which needs to be processed in an Access database. I can not find the proper way to:

- find a specific node
- iterate from there

The XML file is an international bank file:

Code:
<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<GrpHdr>
<MsgId>001-2013-09-19-18:12:17</MsgId>

[Code] ....

I started quite simple, just wanted to read to node MsgId. This is the code I use:

Private Sub ReadXML_Click()
Dim aDoc As DOMDocument60
Dim aNode As IXMLDOMNode
Set aDoc = New MSXML2.DOMDocument60
aDoc.async = False
aDoc.Load DLookup("C:Sample.XML")

[Code] ....

Whatever I try: //MsgId or MsgId the results is "No nodes". How to read to XML.

Besides reading one node, the next challenge will be iterating the PmtInf node. There can be 1 in the XML file but also 50.

View Replies


ADVERTISEMENT

Modules & VBA :: Access - Read From Text File

Nov 5, 2013

I have a text file that I am using VBA to read and print 2 pieces of data to another text file.The code works to a point, in some instances it does not appear to find the end of file but captures and writes all the data. Or, after printing 36 lines correctly, it then stops writing.

I have stepped through the code and it appears to be capturing the data up past this issue but for what ever reason it does not print it to my text file.

PHP Code:

Option Compare DatabaseOption Explicit    Public Mode As String    Public FUNDREF As String    
Public rst As String Function DAILYAUDITTRAIL()     Close #1    Close #2      Open "C:UsersTEST IN.TXT" For Input As #1    
Open "C:UsersTEST OUT.txt" For Output As # 2      Do While Not EOF(1)     
Line Input #1, rst     If rst Like "KM56Aasdf*" Then        FUNDFINDER    
End If     Loop  End FunctionFunction FUNDFINDER()          

[code]...

View 3 Replies View Related

Modules & VBA :: How To Export A Query To Excel If Access File Is Read Only

Feb 26, 2014

I have an access program that is stored on a SharePoint site. I want to be able to export report to the computer even if I just open the access program as read only. Here's my code:

Code:

Private Sub btnExport_Click()
On Error GoTo btnExport_Click_Err
Dim db As DAO.Database
Dim strSQL As String
Dim qdfTemp As DAO.QueryDef
Dim qryFilter As DAO.QueryDef

[code]...

View 2 Replies View Related

Modules & VBA :: Read CSV Transaction File Line By Line And Add Correct Transactions To Access Table

Nov 29, 2014

I have a module which reads a CSV transaction file line by line and adds the correct transactions to an access table and places the wrong ones in a logfile.Now some transactions are rejected twice there is even one rejected six times. Whereas one wrong transaction is processed only once. I am certainly overlooking something obvious in the logic but what. Here is the relevant code.

Code:

Function ImportCSVForConfederation(inputCSV, ORG)
Dim TNO As Integer, TACT As Integer, TABLE As String, TLINE As String, I As Integer, J As Integer, K As Integer
Dim FLD1 As String, FLD2 As String, FLD3 As String, FLD4 As String, LogFile As String, LogPath As String
Dim Lim As String, ITNO As Integer

[code]....

View 8 Replies View Related

How Can I Read A Text File Into A Database

Jan 4, 2005

This is what I would like to achieve

Each time a person comes into our building, they use a electronic key. The information is recorded into a text file. I would like to extract information as described next



The date from the line marked D. Date is marked in bold

The time from the line marked T. Time is marked in bold

The key number and Location from the line marked M. Key Number & Location is Marked in Bold



Sample of the text file:



D[ Fri 30/04/04 ]

T[ 08:19 ]

M[ Valid key:130 Ing group, tenancy:SUNCITY, door:Lower Roller Dr, panel:SURF CITY. ]

N[ 0 2 0 0 5 23 1 0 0 0 130 2 ]



D[ Fri 30/04/04 ]

T[ 08:22 ]

M[ Valid key:20 LEAD NGUYANST, tenancy:SUNCITY, shaft:0, panel:SURF CITY. ]

N[ 0 1 0 0 5 16 1 0 0 0 20 2 ]



D[ Fri 30/04/04 ]

T[ 08:23 ]

M[ Valid key:556 Ing Group, tenancy:SUNCITY, door:Lower Roller Dr, panel:SURF CITY. ]

N[ 0 2 0 0 5 23 1 0 0 0 556 2 ]



…..and so on the text goes



I am reasonably familiar with access but I have not had any experience with Text Files . Could someone post a sample db that would give me a starting point. any information would be appreciated.



Phil.t

View 6 Replies View Related

Modules & VBA :: How To Read TXT File Into Array For Processing

Oct 23, 2014

I'm getting an error when trying to read a .txt file into an array for processing. The error and a snippet of the code are below.

Run-time error '9'
Subscript out of range

Dim iFileNum As String
Dim strLineInfo()
Dim i As Integer
Dim strExpensesFile As String
strExpensesFile = "c:FinanceExpensesIn.Txt"

[Code] .....

View 9 Replies View Related

How To Read PDF File In MS Access 2010

Sep 9, 2014

I am way beyond my skills trying to read these files.

I am trying to read *.pdf files using VBA. I have tried using some code

Code:
Dim AcroApp As Acrobat.CAcroApp
Dim theForm As Acrobat.CAcroPDDoc
Dim jso As Object
Dim text1, text2 As String
'error occurs here stating"ActiveX component can't create object"

[Code] ....

I have set a reference to Adobe 10 Type Library and Adobe Access 3 Type library. I am using Adobe Acrobat Reader X. I now read them by converting to text file and using FileObject to read the text file and VBA text commands to get the right fields.

View 9 Replies View Related

Read/write Issues After Copying An Access .mdb File

Aug 1, 2006

I'm currently creating an interface program for a MS Access database. I've only used Access once in the past but used other DB's a handful of times so I didn't have any trouble getting the general program created. My issue arose when I tried to make it so that the users needing to use the program can just copy the .exe and the .mdb files and use it.

The program doesn't require users to share the database but to store their OWN programs information in their OWN database, so basically each needs to have their own database with the exact same design (but different data). The original plan was to just get them to copy over a near empty .mdb with the design set up and have them slowly create their own dataset with it. However, upon copying these files between my computer and others it ends up allowing my interface program to retrieve data from the DB but not write any new entries to it. All security permission on the file itself are set to allow read/write to everyone so I'm not sure what's causing this. Is there any other security settings I should worry about? Everything I could find within access seemed to be set so that it could be used freely so I'm not sure what the problem is. Any help would be greatly appreciated.

P.S. - I apologize if there is already a related topic in existence, I am new to these boards and tried to search beforehand for any information on this topic but came up empty handed so decided to start my own topic about this problem.

View 4 Replies View Related

Modules & VBA :: Determine File Format Without Opening Database (Using Access 2007)

Jul 15, 2014

Using Access 2007, can I return a value for CurrentProject.FileFormat WITHOUT opening the database?

I'm looking for a way to determine the file version of a given Access database without actually "opening" the database in Access (I don't want it to ever be visible at all or in any way).

So to open a database in Access 2007 "without opening it," I'm using:

Code:
Dim db As DAO.Database
Set db = DBEngine.Workspaces(0).OpenDatabase("C:Path-ToFile.accdb")

From here, there are at least two different "version" indicators that can be used, as in this example:

Code:
Debug.Print db.Properties("Version").Value
Debug.Print db.Properties("AccessVersion").Value

Now, if you run this code on an Access 2002/2003 .MDB file, you will get:

Code:
4.0
09.50

If you run this code on an Access 2007 .ACCDB file, you get:

Code:
12.0
09.50

Note two important factors:The db.Properties("Version") seems to be returning the JET version from what I can see in research. This is NOT what I'm after.

The db.Properties("AccessVersion") returns THE SAME VALUE for an '07 ACCDB as it does for an '02-'03 MDB, since Microsoft never updated it, apparently.

Now.... the one way that I have found that ACCURATELY describes the version of a given access database file is to use:

Code:
Debug.Print CurrentProject.FileFormat

...as this will always return, for example, 2.0 for an Access 2.0 .MDB file; 10 for an Access 2002/03 .MDB file; and 12 for and Access 2007 .ACCDB file (and there are others; these are AcFileFormat bitmask constants as described in Access support).

BUT, this CurrentProject object doesn't seem to be available (so far as I can see) when using the "open without opening" method described above.

SO, is there any way to return the FileFormat value without opening the database visibly? (Merely basing it in the extension isn't right either.... that would be easy but not accurate as several formats use MDB.

View 5 Replies View Related

Modules & VBA :: Automatically Attach External File To Email Generated By Access Database

Nov 24, 2014

I have an Access 2013 database which will generate a pdf report and attach it to an email using the code:

Code:
DoCmd.SendObject acSendReport, "Report Name", acFormatPDF, Nz(To email address, a), , , "Email Subject", "Email body", True

I would also like to automatically attach on the server to this email. Such a file stored such as servernamesharefilename.pdf. Is it possible to do this?

View 14 Replies View Related

NOT Read Only Access Database

Nov 16, 2004

How do you make an Access database able to have records written to it (NOT read only)?

View 2 Replies View Related

Access Database Read-only

May 4, 2005

I am having problems with ODBC Access data source name. When I want to display some database data in a html table on a webpage there is no problem. But when I send data from a html form to the database I get an OLE DB error. (I am using ADO). I can't remember the message exactly but it was something like

Microsoft OLE DB Provider for ODBC drivers error '80004005'
[Microsoft][ODBC Microsoft Access driver] The command must be execute on a query which can be edited.
insert.asp, line 50

For some reason my database is read-only. And I don't want that. I tried
1. ODBC administrator deleting and creating a fresh System DSN, checked if there Read-Only wasn't marked on.
2. Deleted my browser cache.
3. Restarted computer several times again
4. Installed MDAC 2.8 again.

btw. I have created the table with MS Access XP and i am using Windows XP.
Below is my code.

[code]
<FORM ACTION="insert.asp" METHOD="post">
Barcode: <INPUT TYPE="text" NAME="a1" SIZE="15"><BR>
Artist: <INPUT TYPE="text" NAME="a2" SIZE="40"><BR>
Album: <INPUT TYPE="text" NAME="a3" SIZE="50"><BR>
<INPUT TYPE="submit" VALUE="Send">
<INPUT TYPE="reset" VALUE="Clear"><BR>
</FORM>
<%
a1 = request.Form("a1")
a2 = request.Form("a2")
a3 = request.Form("a3")
if ((a1 <> "") and (a2 <> "")) or ((a1 <> "") and (a3 <> "")) then
Set db=Server.CreateObject("ADODB.Connection")
db.ConnectionTimeout=40
db.Open "DSN=pieter", "admin"
sql = "INSERT INTO albums VALUES ('"&a1& "','"&a2& "','" &a3& "')"
Set rs = Server.CreateObject("ADODB.Recordset")
<----- Here is the error ----> db.execute sql
db.close
Set db=Nothing
end if
%>
[code]

View 2 Replies View Related

Modules & VBA :: Check If Database Is Open (Read Only Mode)

Jul 16, 2015

I would like to be able to check if a db is open and if it is to prevent the user from proceeding.

I use the Access 2013 Runtime. I can check if a db is open by trying to open Exclusively, using something like

Code: [URL] ....

But if the db is already open Not exclusively and I try to open it exclusively it does not raise an error and it allows the user to open the db in Read Only mode.

I would like to be able to prevent this, because careless and/or inexperienced users may open several instances of the db.

Of course, if the db is already open exclusively it does not allow you to open it exclusively another time.

View 5 Replies View Related

I Can Read, But Not Write To My ACCESS-database??

May 31, 2005

I have an access database and some asp-code on my computer which only works one way?
I can read from it, but not write?

...and when I put the asp-code and the database on anohter server it works fine.
..what setting do I have to do, to make it work on my computer?

I have another asp-site with a mySQL-database on my compter which works fine...but
it doesn't work with my access-database...hmm...I can only read from it.

View 5 Replies View Related

General :: Opening Access Database In Code As Read Only

Jul 30, 2013

I am trying to open up an Access database as read-only from another running Access database. The code I have to open the database currently reads:

"""C:Program FilesMicrosoft OfficeOFFICE11MSACCESS.EXE"" ""f:commonpattyTraining Database.mdb", 1)

How do I change to read only?

View 3 Replies View Related

General :: Database In Read Only Mode On Server In Access 2010

Jul 18, 2012

I'm working in Access 2010. I created a database that I want to post in a server on the read-only mode, so that users can not change forms or querys. How can I do this in Access 2010?

View 11 Replies View Related

Moving Database To New Computer (Win XP Pro / Access 2003) - Data Has Become Read Only

Feb 20, 2013

Moving to new computer, both under Win XP pro, Access 2003. New computer is MacBook Air running Parallels. Transferred Access database via an external hard drive. Now the data shows up as Read Only. Is there a procedure to run down the cause and make the data accessible?

View 3 Replies View Related

Can't Read Recent File Names On File Menu

Oct 19, 2006

I'm using Access 2000. When I click the File menu to go to a recently used file, the entire path is shown. With my file system, the File drop down widow is about 50 characters too short to show the entire path all the way out to where I keep my database. Is there a way to shut off the viewing the entire path "feature?"

View 2 Replies View Related

Modules & VBA :: Access Read Email Messages And Populate Table

Feb 11, 2014

Currently have an Access db filled with different departmental information. Trying to build a workflow mechanism that will validate the status of a certain "Event".

70-80 different projects in one table. This table has Due Date for the project in itlAll of the days between milestones are static. There are 18 different Milestones covered by 6 departments.Table built to hold status of project. which includes notes for every milestone and date completed. 37 fields (date and memo field each with id number to relate back to project table

A generated email that emails the parties who are late or their milestone is upcoming. (can do this already, but see the other requirement)When users receive email they need to reply in the email that was sent to them the date and what the result of what they did in the email. Users will be using mobile devices, laptops and desktops to respond.Could use Collect Data feature, but it is not easily manipulated with vb. Also, it will not all information to be edited in a query.

View 3 Replies View Related

Modules & VBA :: Copy Access Data Into Excel Template In Read And Write Mode

Jun 20, 2015

How to open a pre filled excel template in read and write mode from msaccess vba and insert data from msaccess tables into specific columns in excel.

Rename the tabs in excel sheet based on a specific column in the access data.

Each row in the table will go to a seperate tab in excel.

Save the excel template after populating the necessary data into different tabs.

View 3 Replies View Related

Warning Message On Form While Data Is Being Processed

Jul 11, 2013

I do have a DB that takes some data from Stripes and imports them into access. Since this will be a multi user DB I want to make a warning form.

Basically a user will do the download, I want a form or a pop up message that will show to the next user that will open the DB while the download process is ongoing, to see that the download data process is still ongoing, That he needs to wait until the data download has finished.

View 7 Replies View Related

Access Database Suddenly "Read-Only"

Oct 26, 2007

Hello,
I have an Access database that for some reason just converted to "read-only". I used to be able to open the database and do whatever, now it says it is read only. I have checked the permissions for both the database itself and the folder it is in and they both do not have "read-only" selected. What I really don't understand is if I use my application that uses the database (written in ColdFusion) I get the error - must use an updateable query. BUT if I continue to hit refresh, then it'll work! So it's like it works sometimes, but not all the time - as if it's switching back and forth between read-only and not read-only. Does anyone have any suggestions?
Thank you!!

View 5 Replies View Related

Create Linked Read-Only File

Feb 13, 2014

Let's say I have a database saved in Folder 1. Is there a way for me to create a read-only copy of that database in Folder 2 so that it can be up-to-date with the changes made in the Folder 1 database? I am running Windows 7.

View 10 Replies View Related

Modules & VBA :: Setting Up Database Library File

Jul 28, 2013

I am using Access 2010.

I want to set up a Library File containing code that I can call from numerous access databases.

I try to make reference to the newly created Library.accdb file in Tools - References and get the error message: Name conflicts with existing module, project or object library.

I have checked the names of all of these and there does not appear to be a conflict.

View 1 Replies View Related

Modules & VBA :: Check If File Exists In Database Or Not

Nov 4, 2013

I have code working for some workers here ,who used to save excel files in a folder and my databse upload those files into database and then do the rest.I am looking for a code in vba which,on upload button matches the file in table and if the file already exists ,it should not upload again in the table and if it does not exists it should upload . I have attached my code below :

Private Sub Command0_Click()
Dim strcPath As String
strcPath = "O:QA FilesQC ReportingPending Review"
Dim strcNewPath As String

strcNewPath = "O:QA FilesQC ReportingMovedFiles" & Format(Now, "yyyy-mm-dd h-mm-ss") _
& " Excel Files" & ""

[Code] .....

View 1 Replies View Related

2003 Problem With Read-Only File Attribute.

Nov 3, 2005

I have a Front-End Access Data Project file (ADE compiled format for distribution) that I purposely have the Read-Only file attribute set to True.

I've been using it this way for about 7 years starting with Access 97 and the current version is 2000.
I am upgrading the app to 2003 now and everything with the conversion is fine except when I set the Read-Only file attribute to True it all of a sudden when starting it no longer connects to the Back-End (sql server) and displays a "form load cancelled" error before hanging.

If I disable the Read-Only attribute, everything is fine again, but I prefere not to do this because that will require me to rework my auto updater.

I use it this way because it prevents bloating of the file and allows for my auto updater to determine new version by using the file modification date.

Any Idea's?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved