SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Fetching data from an SQL Server in to an Access database


Fetching data from an SQL Server in to an Access database

Author
Message
rpouwels
rpouwels
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 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
rpouwels
rpouwels
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 20
Is the the right subforum for this question?
Sean Lange
Sean Lange
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: General Forum Members
Points: 64565 Visits: 17978
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 Modens 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)
rpouwels
rpouwels
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 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?
Andrew Kernodle
Andrew Kernodle
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1370 Visits: 8135
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.

- :-D
Sean Lange
Sean Lange
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: General Forum Members
Points: 64565 Visits: 17978
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 Modens 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)
rpouwels
rpouwels
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 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 Smile
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search