Link between ADP and SQL Server

B

Bob Davies

I have an SQL Server database which has been upsized from
Access. I have written a procedure that Creates a new
table.

However, the ADP cannot see the new table until I go into
the table list and hit f5. I need to refresh this link
automatically.


Public Function fnc_test()
Dim cn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
Set db = CurrentDb

cn.Provider = "sqloledb"
cn.Properties("Data Source").Value = "(Local)"
cn.Properties("Initial Catalog").Value = "GDLSQL"
cn.Properties("Integrated Security").Value = "SSPI"
cn.Open

cmd.ActiveConnection = cn
cmd.CommandText = "fnc_master"
cmd.CommandType = adCmdStoredProc

tbl = "temp_tbl_master"
DoCmd.DeleteObject acTable, tbl

Set rs = cmd.Execute

End Function
 
J

Jerry Boone

Application.RefreshDatabaseWindow

It's also documented in the Help file :)

--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz
Secure Hosting and Development Solutions for ASP, ASP.NET, SQL Server, and
Access
 
J

Jerry Boone

Interesting... doesn't work in AXP either...

It does work in Access 2003 though - geez...

--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz
Secure Hosting and Development Solutions for ASP, ASP.NET, SQL Server, and
Access


Eva Etxebeste said:
And It's also documented in the KB :)

ACC2000: RefreshDatabaseWindow Method Does Not Work in an Access Project
(ADP)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;304256

Thanks Jerry, this problem is a old friend of mine :) and your answer let
me find the solution :))))

Regards
--
Eva Etxebeste [MS MVP Access]


Jerry Boone said:
Application.RefreshDatabaseWindow

It's also documented in the Help file :)

--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz
Secure Hosting and Development Solutions for ASP, ASP.NET, SQL Server, and
Access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top