cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Anonymous
Not applicable
Regarding this post about adding a comupter manually to the database, it can be tricky if we don't know the rules or fields needed to insert the computer hostname.

I can insert one record like this:
Computername: (leave it empty, it's automatically generated)
Computer: Hostname_of_the_computer

The problem I see is that the computer is not created in the table tblCompCustom - I need to add computers manually so I can fill the inventory data whenever they arrive and get in the stock. Can you please inform how do I get that table filled automatically?
4 REPLIES 4
Hemoco
Lansweeper Alumni
this will help: http://p2p.wrox.com/access-vba/61031-running-stored-procedure-adp-module.html

Generate the sql string first, make sure you place single quotes around the string values.
Anonymous
Not applicable
This is not a lansweeper question, but maybe for you it's just a breeze. I've created a stored procedure listed bellow. Now I want to get values from an ADP form project to the stored procedure, any idea on how to do it?

CREATE procedure [dbo].[Custom_InsertComputer]
@computer nvarchar(300),
@Domain nvarchar(300)
as
DECLARE @computername int
insert into tblComputers (Computer,Domain,ComputerUnique) values (@computer,@DOMAIN,@domain + '\' + @computer + '\1')
set @computername = @@identity
insert into tblCompCustom (Computername) values (@computername)


Thank you very much.
Anonymous
Not applicable
Thanks that gives me an idea. I had to change it a bit to work:

CREATE procedure InsertComputer as
DECLARE @computer nvarchar(300)
set @computer = 'computer'
DECLARE @DOMAIN nvarchar(300)
set @DOMAIN = 'domain'
DECLARE @computername int
insert into tblComputers (Computer,Domain,ComputerUnique) values (@computer,@DOMAIN,@domain + '\' + @computer + '\1')
set @computername = @@identity
insert into tblCompCustom (Computername) values (@computername)


I just need to adapt it to run with parameters from Access ADP.
Hemoco
Lansweeper Alumni
try this:

CREATE procedure InsertComputer as
DECLARE @computer nvarchar(300) = 'computer'
DECLARE @DOMAIN nvarchar(300) = 'domain'
DECLARE @computername int
insert into tblComputers (Computer,Domain,ComputerUnique) values (@computer,@DOMAIN,@domain + '\' + @computer + '\1')
set @computername = @@identity
insert into tblCompCustom (Computername) values (@computername)