Re: Help with found code
- From: "Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxx>
- Date: Tue, 2 Dec 2008 07:31:43 -0500
Okay, I see.
I only see three value fields in your SQL statement:
INSERT INTO T_CurrentUsers(COMPUTER_NAME, LOGIN_NAME, CONNECTED,
SUSPECT_STATE) VALUES ('WSUSJXC2B2A169A ', 'admin
', 'True ', )
The only thing I can think of is that there are special characters in the
apparent spaces between the PC Name and the closing quote.
Let's step back a minute, though. Why do you want to store this information
in a table?
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Stephen sjw_ost" <Stephensjwost@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:241290CB-6771-4555-8E90-24E7B3365382@xxxxxxxxxxxxxxxx
WSUSJXC2B2A169A is the PC NAME. I mearly called it PC NAME when descrbing
the
error. PC NAME is not part of the code, it is only a description of
WSUSJXC2B2A169A that I used to present the error that was occuring. Sorry
for
the confusion.
"Douglas J. Steele" wrote:
While WSUSJXC2B2A169A is a PC NAME, I cannot see how your error message
would mention PC NAME in it since your code doesn't call anything PC
NAME!
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Stephen sjw_ost" <Stephensjwost@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:3C4CBF2A-970E-41C5-BC7B-93FD44C9C639@xxxxxxxxxxxxxxxx
Immediate Window shows;
INSERT INTO T_CurrentUsers(COMPUTER_NAME, LOGIN_NAME, CONNECTED,
SUSPECT_STATE) VALUES ('WSUSJXC2B2A169A ', 'admin
', 'True ', )
When it fails. the WSUSJXC2B2A169A is PC NAME.
I have a table T_CurrentUsers in both the IDAUSER.mdb and AGETNID.mdb.
"Douglas J. Steele" wrote:
I don't see PC NAME anywhere in your code!
Inside the loop, try:
While Not rs.EOF
strSQL = "INSERT INTO T_CurrentUsers" & _
"(COMPUTER_NAME, LOGIN_NAME, CONNECTED, SUSPECT_STATE) " & _
"VALUES ('" & rs.Fields(0) & "', '" & rs.Fields(1) & "', '" & _
rs.Fields(2) & " ', " & rs.Fields(3) & ")"
Debug.Print strSQL
cm.CommandText = strSQL
cm.Execute
rs.MoveNext
Wend
Now, when the code fails, go to the Immediate Window (Ctrl-G) and see
the
SQL string printed there.
Note that I've got a space after the closing parenthesis on the second
line
of the SQL statement.
.
- Follow-Ups:
- Re: Help with found code
- From: Stephen sjw_ost
- Re: Help with found code
- References:
- Re: Help with found code
- From: Stephen sjw_ost
- Re: Help with found code
- From: Douglas J. Steele
- Re: Help with found code
- From: Stephen sjw_ost
- Re: Help with found code
- From: Douglas J. Steele
- Re: Help with found code
- From: Stephen sjw_ost
- Re: Help with found code
- From: Douglas J. Steele
- Re: Help with found code
- From: Stephen sjw_ost
- Re: Help with found code
- From: Douglas J. Steele
- Re: Help with found code
- From: Stephen sjw_ost
- Re: Help with found code
- From: Douglas J. Steele
- Re: Help with found code
- From: Stephen sjw_ost
- Re: Help with found code
- Prev by Date: Re: Trying to Send Email, Via Outlook, Using VBA
- Next by Date: Re: Compare Records & Move to new table in VBA
- Previous by thread: Re: Help with found code
- Next by thread: Re: Help with found code
- Index(es):
Relevant Pages
|