Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Fetching data from an SQL Server in to an Access database Expand / Collapse
Author
Message
Posted Tuesday, September 25, 2012 5:21 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 22, 2012 12:25 AM
Points: 8, Visits: 20
Hi Everybody,

I am trying to fetch some data from an SQL Server Database.
I have a query, but it keeps prompting for credentials.

SELECT Invoices.NavisionInvoiceNumber, Invoices.NavisionInvoiceDate, Invoices.NavisionCustomerNumber, Invoices.NavisionCustomerName, Invoices.NavisionTotalDeliveries, Invoices.FilesDistributed, Invoices.IsComplete, Deliveries.DeliveryNumber, Deliveries.PDFName, Deliveries.NumberOfTries, Deliveries.FilesMoved, Deliveries.HasFailed, Deliveries.IsComplete  
FROM LVA.dbo.Deliveries Deliveries left outer join LVA.dbo.Invoices Invoices on Deliveries.InvoiceId = Invoices.Id ORDER BY Invoices.NavisionInvoiceNumber, Deliveries.PDFName

It keeps asking for an DSN (The DSN is on a networkshare)

How can i make sure that it goes automatically?

Edit: It has to be imported in Access 2010

Regards,
Robert
Post #1363952
Posted Tuesday, September 25, 2012 6:32 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 22, 2012 12:25 AM
Points: 8, Visits: 20
Is the the right subforum for this question?
Post #1363986
Posted Tuesday, September 25, 2012 8:01 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:41 PM
Points: 13,315, Visits: 12,182
rpouwels (9/25/2012)
Hi Everybody,

I am trying to fetch some data from an SQL Server Database.
I have a query, but it keeps prompting for credentials.

SELECT Invoices.NavisionInvoiceNumber, Invoices.NavisionInvoiceDate, Invoices.NavisionCustomerNumber, Invoices.NavisionCustomerName, Invoices.NavisionTotalDeliveries, Invoices.FilesDistributed, Invoices.IsComplete, Deliveries.DeliveryNumber, Deliveries.PDFName, Deliveries.NumberOfTries, Deliveries.FilesMoved, Deliveries.HasFailed, Deliveries.IsComplete  
FROM LVA.dbo.Deliveries Deliveries left outer join LVA.dbo.Invoices Invoices on Deliveries.InvoiceId = Invoices.Id ORDER BY Invoices.NavisionInvoiceNumber, Deliveries.PDFName

It keeps asking for an DSN (The DSN is on a networkshare)

How can i make sure that it goes automatically?

Edit: It has to be imported in Access 2010

Regards,
Robert


The details are pretty sparse here. You are trying to import data from sql server to Access? How are you trying to do this import?


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1364057
Posted Tuesday, September 25, 2012 9:35 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 22, 2012 12:25 AM
Points: 8, Visits: 20
Hi Sean,

I am trying to import the data in to Access from an SQL Server Database.
I already have the data imported, but Access keeps bugging me with the location for the DSN file. Is it possible for Access to find the DSN file, because I want to have everything automated for the end users.

Or is there another way to import the data?
Post #1364137
Posted Tuesday, September 25, 2012 10:38 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Today @ 3:19 PM
Points: 602, Visits: 6,525
Are you using a Pass-Through Query in Access? If so, right-click the query, open it in Design View, and open the Property Sheet. The second item in the list should be ODBC Connect String; click the box to the far right on that line, and it should prompt you for the DSN to use for that query. Point it to the one you'd like to use, and the query should automatically use that DSN from now on. If you're using a query written in Access Visual Basic, you'll need to write a connection string to use with the query; there's quite a few utilities on the web that can generate one for you given some details.



-
Post #1364178
Posted Tuesday, September 25, 2012 11:25 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:41 PM
Points: 13,315, Visits: 12,182
rpouwels (9/25/2012)
Hi Sean,

I am trying to import the data in to Access from an SQL Server Database.
I already have the data imported, but Access keeps bugging me with the location for the DSN file. Is it possible for Access to find the DSN file, because I want to have everything automated for the end users.

Or is there another way to import the data?


Are you saying you import this data repeatedly? If so, can you create a view in sql instead? It seems highly inefficient to me to import data over and over.

Do you have the DSN setup on the machine for each user? Can you instead use some VBA and create an ADO connection rather than using a machine DSN?


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1364193
Posted Wednesday, September 26, 2012 12:01 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 22, 2012 12:25 AM
Points: 8, Visits: 20
hisakimatama (9/25/2012)
Are you using a Pass-Through Query in Access? If so, right-click the query, open it in Design View, and open the Property Sheet. The second item in the list should be ODBC Connect String; click the box to the far right on that line, and it should prompt you for the DSN to use for that query. Point it to the one you'd like to use, and the query should automatically use that DSN from now on. If you're using a query written in Access Visual Basic, you'll need to write a connection string to use with the query; there's quite a few utilities on the web that can generate one for you given some details.


I am using a Pass-Through Query... I will try it!

Edit: Thanks, Hisakimatama, It worked :)
Post #1364445
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse