User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » VBscript Question WTF is going on? Page [1]  
AntecK7
All American
7755 Posts
user info
edit post

Okay im running this script, and im getting what appears to be out of order code execution, or some weird compile time crap. Anybody got ideas.


OUTPUT

SOMESN 10
SOMEHOSTNAME 13
HP Compaq dc7800 Convertible Minitower 38
Hewlett-Packard 15
DM\USERNAME 10
Microsoft Windows XP Professional 33
2 1
Intel(R) Core(TM)2 Duo CPU E4600 @ 2.40GHz 47
C:\invlen.vbs(148, 2) Microsoft OLE DB Provider for SQL Server: String or binary
data would be truncated.


what the heck1
2.33 4
What the hell
2012 4
127.0.0.1 14
00:0F:FE:EC:1DD 17
CompSerial, CompName, CompModel, CompManufacturer, CompUser, ScavengeDate, CompO
s, CompServicePack, CompCpuName, CompCpuSpeed, CompRam, CompIp, CompMAC

Here
In function
WE GOT HERE SOMEHOW

C:\>
End Output
The code Lines 98-118

WScript.Echo CompName&" "&Len(CompName)
WScript.Echo CompModel&" "&Len(CompModel)
wScript.Echo CompManufacturer&" "&Len(CompManufacturer)
WScript.Echo CompUser&" "&Len(CompUser)
WScript.Echo CompOs&" "&Len(CompOs)
WScript.Echo CompServicePack&" "&Len(CompServicePack)
WScript.Echo CompCpuName&" "&Len(CompCpuName)
wscript.echo "what the heck1"
wscript.echo CompCpuSpeed&" "&Len(CompCpuSpeed)
wscript.echo "What the hell"
WScript.Echo ""&CompRam&" "&Len(CompRam)
WScript.Echo CompIP&" "&Len(CompIP)
WScript.Echo ""&CompMAC&" "&Len(CompMAC)

Wscript.echo "CompSerial, CompName, CompModel, CompManufacturer, CompUser, ScavengeDate, CompOs, CompServicePack, CompCpuName, CompCpuSpeed, CompRam, CompIp, CompMAC"
wscript.echo
CompCpuName="Test"
WScript.Echo "Here"

UpdateDB=UpdateDatabase()

the function UpdateDatabase() is on line 124-160 ish

Lines incldued below 136-153

Set mConnection = CreateObject("ADODB.Connection")

mConnection.Open SqlCon, SqlUser, SqlPass

'Checks the databse for an existing record
Set mRecordset = CreateObject("ADODB.Recordset")
mRecordset.open SqlSelect, mConnection
RecordCheck = mRecordset.bof

'Decides either update or insert depent on the result of the record check
if RecordCheck = -1 Then
WScript.Echo "WE GOT HERE SOMEHOW"
mConnection.Execute SqlInsert This is the line with the error

Else
mConnection.Execute SqlUpdate

End If

Why the hell is that error for that line appearing in the middle of my echo statements?

[Edited on March 9, 2010 at 5:23 PM. Reason : dd]

3/9/2010 5:21:35 PM

 Message Boards » Tech Talk » VBscript Question WTF is going on? Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.