
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2011 04:53 PM
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?
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?
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2011 05:21 PM
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.
Generate the sql string first, make sure you place single quotes around the string values.

Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2011 04:59 PM
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?
Thank you very much.
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2011 06:08 PM
Thanks that gives me an idea. I had to change it a bit to work:
I just need to adapt it to run with parameters from Access ADP.
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.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2011 08:52 AM
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)
