|
|
|
Forum 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
|
|
|
|
|
Forum 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?
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 12:35 PM
Points: 8,633,
Visits: 8,271
|
|
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
|
|
|
|
|
Forum 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?
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Today @ 12:10 PM
Points: 172,
Visits: 3,049
|
|
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.
---------------------------------- My journal of things I'm learning about SQL
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 12:35 PM
Points: 8,633,
Visits: 8,271
|
|
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
|
|
|
|
|
Forum 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 :)
|
|
|
|