Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Host_ID(), & changing Access adp Workstation ID dynamically

Status
Not open for further replies.

JohnReaume

Programmer
May 30, 2003
9
US
I have an application that filters several items of SQL data by using the device ID of the source computer.

The records are added via VB with a special ID for the valid records, and with the DLL call "GetComputerNameA" to keep the filter specific to the device. Then I run the Stored Procedure with everything works great.

When I copy a completed adp/ade file to another device, the workstation ID is staying the same, and that is being used for the call back to SQL "the Host_Name() function"

Is there anyway to change the File/Connection/Data Link properties dynamically?
I tried ClosedConnection, OpenConnection and it does not change the Workstation ID
HELP
 
Part Two...

Add the following stored procedure to your existing adp file.

CREATE PROCEDURE dbo.ComputerName
AS SELECT HOST_NAME() AS DeviceID

Run it before and after you change the File/Connection/All/Workstation ID field
Notice how the DeviceID changes?

Now copy your adp to another computer and notice how the Workstation ID does not change until you clear it in the Data Link Proprties dialog box

The ";Workstation ID=" or ";WSID=" in OpenConnection does not modify it.
I've spent countless hours on the web with no luck
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top