473,322 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Getting data from Access DB while in excel.

I have an established secured access database. I would like to read
fields in the Access DB while im in excel via the external database
query tools. However im getting an error about not having permission
to the db. I enter my crudentials and I still get the error. Any ideas
on how to go about this?

Sep 6 '07 #1
2 1908
On Sep 7, 5:45 am, radink <radi...@gmail.comwrote:
I have an established secured access database. I would like to read
fields in the Access DB while im in excel via the external database
query tools. However im getting an error about not having permission
to the db. I enter my crudentials and I still get the error. Any ideas
on how to go about this?
Off the cuff, I would say you'd want to create an ODBC DSN name on the
machine (see Administrative Tools Data Sources (ODBC) on WXP and
specify the filename, workgroup file, credentials. Then using the
external database query tools connect via that DSN.

Sep 6 '07 #2
On Sep 6, 2:45 pm, radink <radi...@gmail.comwrote:
I have an established secured access database. I would like to read
fields in the Access DB while im in excel via the external database
query tools. However im getting an error about not having permission
to the db. I enter my crudentials and I still get the error. Any ideas
on how to go about this?
Here's a shot in the dark. I noticed that getting Access data from
Excel requires some delicate handling of the Recordset object because
it doesn't know what CurrentDb means. After setting a reference in
Excel to the DAO Object library I tried:

Sub Macro1()
Dim MyDB As Database
Dim MyRS As Recordset
Dim strSQL As String

strSQL = "SELECT * FROM MyTable;"
Set MyDB = Workspaces(0).OpenDatabase("C:\Test.mdb")
Set MyRS = MyDB.OpenRecordset(strSQL, dbOpenSnapshot)
MyRS.MoveFirst
MsgBox (MyRS("MyField"))
MyRS.Close
Set MyRS = Nothing
Set MyDB = Nothing
End Sub

Note that I haven't addressed the security part. The OpenDatabase
method has a 'connect' variant "(String subtype) that specifies
various connection information, including passwords."

I'm not sure what the external database query tools are. Perhaps you
can teach me about them?

I don't know if anyone will find the code useful or not. Note that
Personal.xls will probably need to be used if the macro needs to work
within all spreadsheets. I think that Personal.xls needs to be
unhidden, macro edited, saved and then hidden again.

James A. Fortune
CD********@FortuneJames.com

Sep 7 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
1
by: Steven Stewart | last post by:
I have a user who has been using Excel for a while to keep statistics and print reports. She finds using it cumbersome because of long formulas and a lot of copying and pasting. I have designed...
3
by: Mads Petersen | last post by:
I'm stuck in this code. Hope you can and will help me. I launch it from excel. I have made the following code work, but not as i whant. I need the ranges to be working with something like xlDown....
0
by: Jack | last post by:
Windows 2K Pro Access/Excel 2003 Hi there, I have a large number of password protected Excel Workbooks. The files are protected by code that runs when the workbook opens. The code asks the...
11
by: Hi5 | last post by:
Hi, I am new to access I usedto work in Oracle and Mysql. I am after a way that enables me to populate a database I designed in access with lots of data which can be sorted in excel sheets, ...
6
by: syvman | last post by:
Hi everyone... I am pulling my hair out trying to do this, and was wondering if someone could give me some assistance... I have an Excel spreadsheet containing several worksheets. I'd like to be...
2
by: Robert Dyke | last post by:
Hey ... I've got about 500 Excel files with data stored in them in tabular format ... (my coworker used excel as a database). I want to write a vb6 program that will open up these files and get...
0
by: jetaw03 | last post by:
guys, i need help in using VB 6.0.can you help me to get a data from an excel file from ms access and put it in ms excel..pls help me guys.. here is the sample of the file in access: sum1 sum2...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.