well, although you didn't state it in your post, my guess is that your running this script with KiXtart 4.x and unfortunately (fortunately?), the OLExxx functions have become extinct !
If this is the case, will have to convert this script to 4.0 syntax (COM Syntax), if you are running this script against 3.63 please advise.
#40671 - 2003-06-0209:43 PMRe: Writing to access db
brewdude6brewdude6
Hey THIS is FUN
Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
First off, I know you guys are going to rail me about using UDF's and newer versions of Kix, but I'm stuck in the past I tell ya...please forgive. I've got the script posted above dumping to my access db like I want, BUT I'd also like to capture the IP address of the machine that I'm executing the GETDISKSPACE command on. I've got as far as piping the ping results into a .txt file, but am having trouble figuring out how I'm going to strip that and insert it into my db. Here is what I've got so far on parsing into a text file. If any of you that can offer some help would be appreciated.
code:
Break On Shell "cmd.exe /c ping romburner -n 1 > c:\backup1\result.txt" If Open(3,"result.txt",2) = 0
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs. -Mark Twain
Take a look at the KiXtart Manual under READLINE(). Read the lines until the desired line, then use LEFT/RIGHT/SUBSTR/INSTR to parse out the IP address.
_________________________
There are two types of vessels, submarines and targets.
once upon a time there was a young dude who was sentenced to track main folders diskspace on all the customers Company Servers over an unspecified period of time, not for being naughty or soemthing, just for one others satisfaction.
So, the young dude decided to run a script on a daily base on all the kingdoms Servers using diruse.exe and write those results to an ini based file on that Server. Furthermore he ran, clever as he was, a scheduled script on his machine that grabbed all the results of all the servers to be written to a database on the young dudes Domain Servers.(Shawn, the Wizzard of OLE was kind enough to show the young dude how to write through KiX 3.x to a database) So the days did go by and became weeks, the weeks grew up to be months and the young dude did report to his Boss ... and the Boss said: "What? Diskspace tracking? Nice thing indeed, but who wants to know this ?" "Ummm ... I thought it was the cusomers big chief that wanted us to report this over an unspecified amount of time..." the young dude replied. "Oh yeah," the boss said, "they decided to implement a 'not to be named here expensive Systems Management System' in the mean time, so we don't need that anymore!"
And the morale of this tale :
Don't expect too much in writing code, but always expect the Spanish Inquisition
#40680 - 2003-06-0303:46 PMRe: Writing to access db
brewdude6brewdude6
Hey THIS is FUN
Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
Wow, thanks for the help guys. It really is appreciated. I am now capturing IP's like I wanted, but now I'm having a problem writing drivespace to my db now. I get the server named "romburner" c:\ drive and the rest are ".0" in their table. I'm sure that I'm doing something fundamentally wrong and just can't see the forrest for the trees. I've run this in debug mode with no errors. Here's the code....btw, I'm using ver. 3.62
#40682 - 2003-06-0308:54 PMRe: Writing to access db
brewdude6brewdude6
Hey THIS is FUN
Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
Thanks for the tip, although I don't want to ask for someone to do this for me, I am stumped. I looked up the use of "val" and I'm at a loss as to what is failing.
Is it possible that the variable I'm declaring initially isn't getting changed?
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs. -Mark Twain
Im a little bit at a loss in terms of what exactly isn't working. I assume that the oledb inserts are working were and still are working ? Whats broke exactly ?
#40685 - 2003-06-0311:02 PMRe: Writing to access db
brewdude6brewdude6
Hey THIS is FUN
Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
Sorry for not being concise in my last post. I am writing to my db just fine. Shawn, when I took your code and made the ":IP" section, everything works without errors except that the drivespace that is returned for every other drive and computer other than the first drive checked (romburner drive c:\) returns a "0" value. The script doesn't error at all.
I've put a few spaces in the script to hopefully make it a little easier to read.
#40686 - 2003-06-0404:24 AMRe: Writing to access db
brewdude6brewdude6
Hey THIS is FUN
Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
I guess if you struggle long enough you eventually find your way....at least I seem to. My problem was in my "close" statement for the txt file I was writing to. Thanks to everyone that tried and did help me.
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs. -Mark Twain