Link between ADP and SQL Server

  • Thread starter Thread starter Bob Davies
  • Start date Start date
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
 
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
 
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
 
Back
Top