#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default SQL Server Login

Hi,

For two weeks ago I have exported some data via Data, Import, New DBase.
This was retrieved from server X
Last week we changed host and therefore the Dbases are no longer on server X
but on server Y. When i try to update my data, it is not working ofcourse.
How can I change the source of the data so it is retrieving the data from
server Y, without creating a new Dabse request.

Thanks in advance

Ronald

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default SQL Server Login

I don't know if this is the best way, but it works. You can copy the SQL
statements from you old query to a new query.

1) get the Old SQL statements from worksheet menu. select worksheet where
query results are placed

a) Data - Import External Data - Edit Query
b) Press next until finish appears
c) select View Data or edit Query in Microsoft Query. Press finish
d) In Microsoft Query Menu select View - SQL
e) Copy SQL statements

2) Create new query selecting the database file on new server. Don't worry
about options because the SQL statements will change the request. Then
repeat 1) above and paste old SQL statements into New query.


"Ronald" wrote:

Hi,

For two weeks ago I have exported some data via Data, Import, New DBase.
This was retrieved from server X
Last week we changed host and therefore the Dbases are no longer on server X
but on server Y. When i try to update my data, it is not working ofcourse.
How can I change the source of the data so it is retrieving the data from
server Y, without creating a new Dabse request.

Thanks in advance

Ronald

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default SQL Server Login

Hi Joel,

it won't allow me to edit the query. I need to login on the old server which
is not operational any longer.

ronald
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default SQL Server Login

The macro below should be able to get the connection and sql data. Yo ucan
the create manuall a new connection and add the SQL. This could be automated
with a macro. Try this first.

Sub GetConnection()

Set MyQuery = ActiveSheet.QueryTables.Item(1)
Sheets("Sheet2").Range("A1") = MyQuery.Connection
Sheets("Sheet2").Range("A2") = MyQuery.Sql
End Sub

"Ronald" wrote:

Hi Joel,

it won't allow me to edit the query. I need to login on the old server which
is not operational any longer.

ronald

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default SQL Server Login

I am not a star with macros. if you have the time for it, can you guide me
step-by-step? it should be on the level : click on ..., write this...

Ronald



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default SQL Server Login

Go to worksheet where query is located. Then press Alt-F11. Copy and Paste
code into VBA sheet. Click with mouse anyway in the pasted code and press F5.

"Ronald" wrote:

I am not a star with macros. if you have the time for it, can you guide me
step-by-step? it should be on the level : click on ..., write this...

Ronald

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Login Userform Moh New Users to Excel 4 February 15th 12 10:39 AM
Login Name and now function saran Excel Worksheet Functions 3 August 18th 08 01:11 PM
SQL Server -- Bulk Insert from Excel to SQL Server Madhan Excel Discussion (Misc queries) 0 December 12th 06 03:08 PM
Excel 2003 Error Cannot Locate the Internet Server or Proxy Server Seabee Excel Discussion (Misc queries) 0 November 20th 05 12:03 AM
problem updating link from Novell server to windows server #REF er Ellen Excel Discussion (Misc queries) 0 May 10th 05 09:18 PM


All times are GMT +1. The time now is 06:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"