|
-
Apr 4th, 2013, 03:19 PM
#1
[RESOLVED] Accessing Access DB Without Access
It's been ages since I've done anything with Access but I seem to remember that I should be able to read/write to an Access database as long as that's all I want to do and I don't need reports or forms, etc. How do I do that from Excel and have the Access database be sharable by multiple users?
-
Apr 4th, 2013, 03:32 PM
#2
Re: Accessing Access DB Without Access
reference to ADO
basic connection to existing
Code:
Dim cn As ADODB.Connection, rs As Recordset
Set cn = New Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath & "\qbinfo.mdb"
Set rs = New Recordset
rs.Open "select * from qbinfo", cn, adOpenDynamic, adLockOptimistic
do until rs.eof
cnt = cnt +1
rs.movenext
loop
msgbox cnt & " records returned"
change source path and table names to suit
you can use sql to use criteria for returned records
ado has find and filter methods to locate or filter the records based on some criteria
if your database has password etc, see connectionstrings.com for ...............
s long as that's all I want to do and I don't need reports or forms, etc
you can still have all those, but you have to design your own
i often use access databases, but i have never had access installed
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Apr 4th, 2013, 03:37 PM
#3
Re: Accessing Access DB Without Access
Marty
Short answer, seems to me, would be to write a macro using Excel VBA that ,,
1. Reads the Access file
2. Writes to the Access file
3. Does other stuff on a spreadsheet in the Excel file.
I have not specifically tried this, but, despite the fact that VBA is a crippled
version of VB6, I imagine that it is doable using VBA.
How do you plan to (ahem) access Access?
DAO
ADO
If DAO, and you need some further help, holler.
And, oh yeah, what happened to your other thread?
EDIT
Dang ,, Westconn1 snuck in a post while I was composing.
Spoo
-
Apr 4th, 2013, 03:43 PM
#4
Re: Accessing Access DB Without Access
 Originally Posted by Spoo
Marty
Short answer, seems to me, would be to write a macro using Excel VBA that ,,
1. Reads the Access file
2. Writes to the Access file
3. Does other stuff on a spreadsheet in the Excel file.
I have not specifically tried this, but, despite the fact that VBA is a crippled
version of VB6, I imagine that it is doable using VBA.
How do you plan to (ahem) access Access?
DAO
ADO
If DAO, and you need some further help, holler.
And, oh yeah, what happened to your other thread?
Spoo
1 to 3: Yes that's exactly want I want to do and other than the apparently non-trivial task of actually opening the database (read on) I'm sure I can do it with ADO. As for my other similar thread I thought it got off to a bad start so I decided to try again.
@westconn1: The database I created via Access 2010 wound up with an extension of accdb and I get an "AutomationError Unspecified Error" on this line.
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:\MyPath\test.accdb"
-
Apr 4th, 2013, 03:52 PM
#5
Re: Accessing Access DB Without Access
Marty
10-4.
I'm still an Access 2003, DAO kinda guy, so I can't help much regarding
the connection. Once you work that bit out, I might be able to address
other issues you may have, assuming Westconn1 doesn't beat me to the
punch again ,, 
Spoo
-
Apr 4th, 2013, 04:32 PM
#6
Re: Accessing Access DB Without Access
accdb files can't be used by Jet, so there are two main choices.
The first and easiest is to open the database file in Access and do a "save as" (or whatever it is called in that version) to convert it to an mdb file. Access 2007 can work with both, so I assume Access 2010 can too.
The other option is to download and install the 'replacement' provider ACE, and change the connection string to suit. You will however need to install it for the other users too, and I seem to remember there are conflicts between the 32-bit and 64-bit versions of ACE which mean that they can't be installed at the same time (which could cause problems for some people).
-
Apr 4th, 2013, 05:28 PM
#7
Re: Accessing Access DB Without Access
Strangely accdb seems to be the only choice.
-
Apr 5th, 2013, 01:42 AM
#8
Re: Accessing Access DB Without Access
Marty, will your users be using 32 bit MS Office (Not Windows) or 64 bit?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Apr 5th, 2013, 06:14 AM
#9
Re: Accessing Access DB Without Access
i use visdata to create most databases (mdb), it is installed as part of vb6, though it is quite possible to create database from scratch using code
if you do not need to use the database within access at all there are other choices, including sql and mysql, both i believe are available to use at no cost
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Apr 5th, 2013, 09:26 AM
#10
Re: Accessing Access DB Without Access
WestConn
You sly dog
i often use access.databases, but i have never had access installed
That sounded, well, somewhat iffy.
i use visdata to create most databases (mdb), it is installed as part of vb6,
Aha !! Mystery solved. No longer iffy.
Who knew?
Spoo
-
Apr 5th, 2013, 09:41 AM
#11
Re: Accessing Access DB Without Access
@sid: All will be Windows PCs but I don't know if the operating systems are consistent. I can find out though. BTW I love the logo in your signature.
@westconn1: I'll look into the Visual Data Manager.
-
Apr 6th, 2013, 11:17 PM
#12
Re: Accessing Access DB Without Access
-
Apr 6th, 2013, 11:25 PM
#13
Re: [RESOLVED] Accessing Access DB Without Access
for anyone reading this thread
there are update instructions, on the internet, for the visdata project, to enable visdata to work with /create access 2000 databases, it is simple to update the project then recompile to create an updated exe
the original version only works with access 97 databases
even when updated, visdata is fairly dated, but it suits my needs well, if i need a better database than access 2000 i would go to mysql or similar
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
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
|