Page 3 of 3 <123
Topic Options
#26847 - 2002-08-10 04:42 AM Re: vbs -> Kix
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
[Wink] I posted to it.. I will let you know as soon as I find out.

Thanks
_________________________
Austin Henderson

Top
#26848 - 2002-08-10 04:48 AM Re: vbs -> Kix
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
austin dear.
I saw your post.
I'm using my own bbchecker.
this means I'll get all posts with delay not more than 20 seconds (20 is my setting)

like I have let you know, I'm the one most addicted to kix... well, to the board.
this means: I'll most likely to see the resolution before you.

anyway, if you get it from outside the board, please help my longing to know everything and post the solution...
_________________________
!

download KiXnet

Top
#26849 - 2002-08-10 04:57 AM Re: vbs -> Kix
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
what do you use to check the board? I dont like the web interface...
_________________________
Austin Henderson

Top
#26850 - 2002-08-10 05:00 AM Re: vbs -> Kix
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
check this...
http://81.17.37.55/board/ultimatebb.php?ubb=get_topic;f=13;t=000231

I have done about 2 month coding for it.
I quess 3-6 of the coding was just learning.
anyway, it has raised my post count pretty much... [Big Grin]
_________________________
!

download KiXnet

Top
#26851 - 2002-08-10 05:03 AM Re: vbs -> Kix
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
No kidding! Beweeen that and golf... [Big Grin]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#26852 - 2002-08-10 05:22 AM Re: vbs -> Kix
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, golf is golf.

anyway, checked for the HIGH score of posts on single topic.
I do not include any related topic or version 1 topics.

here are the counts for bbchecker 2 (most of posts are by me):
Kixforms - BBChecker II Pages: 1 2 3 4 5 6 Shawn 127
bbChecker II - rc1 Pages: 1 2 3 4 5 6 Lonkero 147
bbChecker II (RC4) Pages: 1 2 3 Lonkero 59
bbChecker II v1.0 Lonkero 0

the columns with bb are as you know:
topic,starter,replycount

anyway, bbchecker II got count of: 337

this far.
I quess it will change when ppl start finding bugs.

anyway, I think the number gives you some idea what is the reason I've raised in the list:
I tested the code and kept it on.
this way I was allways informed of new post and I had to return to it.
it's so simple. that is also the reason why I made it.
for regular users and for moderators to make sure everyone gets replyed.
_________________________
!

download KiXnet

Top
#26853 - 2002-08-10 02:44 PM Re: vbs -> Kix
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, austin.
you could make the error lookup by yourself as jens seems to be offline.

in every part of the udf where it says if @error exit @error change it to:
if @error
"this command fails"
get $
exit @error

this way you can see where it fails.

I think it has somethink to do with the function input...
_________________________
!

download KiXnet

Top
#26854 - 2002-08-10 02:59 PM Re: vbs -> Kix
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Ok.. problem seems to be in $guipassprompt() it is not returning $GUIPASSPROMPTOLD

Here is the way I tested it.. no errors in the suspect udf... however I should fail on the initial DBConnOpen($ConnDSN,,) but it isnt.. that is returning 0... I will have to do some more testing on my own to locate the problem.. I will post when I check it out some more..

The problem is that this is the part I am seeing failure..
code:
 if @error <> 0
"Error: "@error
$nul = Messagebox("- ERROR CONTACT ADMIN -", "ERROR",4144)
else
$nul = Messagebox("- PASSWORD CHANGED -", "ALERT",4160)
endif

Here is tested code.

code:
;******************************************************************************
;-Author: Austin Henderson
;-Date: 08.05.02
;-Script: Beta Script For Password Sync
;
;-Dependancies: kix32.exe
;******************************************************************************

;Define variables...

;CODING BEGINS
;------------------------------------------------------------------------------
:TOP

:TOP
$NEWPWD = guipassprompt(0,0) ;Call code to get password
"OLD: "$GUIPassPromptOld
"NEW: "$NEWPWD
if ingroup ("TMT User") or ingroup ("TMW User")
$ConnDSN = "DRIVER={SQL Server};SERVER=TRINITY;UID=@UserId;PWD=$GUIPassPromptOld;"
$objConn = DBConnOpen($ConnDSN,,)
while @error <> 0
$nul = Messagebox("- CURRENT PASSWORD INCORRECT -", "ERROR",4144)
$NEWPWD = guipassprompt(0,0) ;Call code to get password
$ConnDSN = "DRIVER={SQL

Server};SERVER=TRINITY;UID=@UserId;PWD=$GUIPassPromptOld;"
$objConn = DBConnOpen($ConnDSN,,)
loop
$SQL = "sp_password NULL,'$NEWPWD','@UserID'"
$SQLExe = DBExecuteSQL($objConn,$sql,)
if @error <> 0
"Error: "@error
$nul = Messagebox("- ERROR CONTACT ADMIN -", "ERROR",4144)
else
$nul = Messagebox("- PASSWORD CHANGED -", "ALERT",4160)
endif
$close = DBConnClose($objConn)
endif

if ingroup ("GP User")
$ConnDSN = "DRIVER={SQL Server};SERVER=GATES;UID=@UserId;PWD=$GUIPassPromptOld;"
$objConn = DBConnOpen($ConnDSN,,)
while @error <> 0
$nul = Messagebox("- CURRENT PASSWORD INCORRECT -", "ERROR",4144)
$NEWPWD = guipassprompt(1,1) ;Call code to get password
$ConnDSN = "DRIVER={SQL Server};SERVER=GATES;UID=@UserId;PWD=$GUIPassPromptOld;"
$objConn = DBConnOpen($ConnDSN,,)
loop
$SQL = "sp_password NULL,'$NEWPWD','@UserID'"
$SQLExe = DBExecuteSQL($objConn,$sql,)
if @error <> 0
$nul = Messagebox("- ERROR CONTACT ADMIN -", "ERROR",4144)
else
$nul = Messagebox("- PASSWORD CHANGED -", "ALERT",4160)
endif
$close = DBConnClose($objConn)e($objConn)
endif

;Let the functions begin
;------------------------------------------------------------------------------
Function DBConnOpen($ConnDSN, optional $ConnTimeout, optional $CmdTimeout)
Dim $objConn, $adStateOpen

$adStateOpen=val('&00000001')

if vartype($ConnTimeout)
$ConnTimeout=val($ConnTimeout)
else
$ConnTimeout=15
endif

if vartype($CmdTimeout)
$CmdTimeout=val($CmdTimeout)
else
$CmdTimeout=30
endif

$ConnDSN=trim($ConnDSN)
if not $ConnDSN
exit 87
endif

$objConn = CreateObject("ADODB.Connection")
if @ERROR
exit @ERROR
endif

$objConn.ConnectionTimeout = $ConnTimeout
if @ERROR
exit @ERROR
endif

$objConn.CommandTimeout = $CmdTimeout
if @ERROR
exit @ERROR
endif

$objConn.Open($ConnDSN)
if @ERROR
exit @ERROR
endif

if not $objConn.State=$adStateOpen
$objComm=''
$DBConnOpen=''
exit @ERROR
endif
$DBConnOpen=$objConn

EndFunction

;------------------------------------------------------------------------------
Function DBConnClose($objConn)
Dim $adStateOpen

$adStateOpen = 1

If vartype($objConn)=9
If $objConn.State = $adStateOpen
$objConn.Close()
if @ERROR
exit @ERROR
endif
EndIf
$objConn=''
else
exit 87
endif

$DBConnClose=@ERROR
EndFunction


;------------------------------------------------------------------------------
function DBExecuteSQL($objConn, $sql, optional $cmdType)
dim $cmdCommand, $rsRecordset
dim $adCmdUnspecified, $adCmdText, $adCmdTable, $adCmdStoredProc, $adCmdUnknown, $adCmdFile,

$adCmdTableDirect

$adCmdUnspecified = -1
$adCmdText = 1
$adCmdTable = 2
$adCmdStoredProc = 4
$adCmdUnknown = 8
$adCmdFile = 256
$adCmdTableDirect = 512

if vartype($cmdType)
$cmdType=val($cmdType)
else
$cmdType=$adCmdText
endif

if vartype($objConn)<>9 or $sql=''
exit 87
endif

$cmdCommand = CreateObject('ADODB.Command')
if @ERROR
"command 1fails"
get $
exit @ERROR
endif

$cmdCommand.ActiveConnection = $objConn
if @ERROR
"command 2 fails"
get $
exit @ERROR
endif

$cmdCommand.CommandType = $cmdType
if @ERROR
exit @ERROR
endif

$cmdCommand.CommandText = $sql
if @ERROR
"command 3 fails"
get $
exit @ERROR
endif

$rsRecordset=$cmdCommand.Execute()
$cmdCommand=''
$rsRecordset=''
if @ERROR
"command 4 fails"
get $
exit @ERROR
endif

$DBExecuteSQL=@ERROR

endfunction

;------------------------------------------------------------------------------
function GUIPassPrompt($case, $force, optional $title)
;This is a GUI password Prompt.
; Syntax:
; GUIPassPrompt(Case Sensetive[0/1] | force[0/1] | Optional Title )
; Case Sensetive [0,1]
; 0 = ignore case
; 1 = all password are case sensitive
;
; Force [0,1]
; "0" will not force a password
; "1" will force the user to enter a password
;
; Title(optional) "Your title here"
; Defalut title = "Please enter your password."
; set this option to change it.
;
;Example:
; ;This will show a non case sensetive password prompt with the default title and

not forced
; $password = GUIpassprompt(0,0)
;
; ;this is a forced case sensetive password prompt with the title "Enter your

password"
; $password = GUIPassPrompt(1,1,"Enter your password")

DIM $title, $case, $top, $left, $height, $Width, $False, $true
DIM $status, $Password1, $password2, $doc, $nul, $html

$password = ""
$top = "100"
$left = "200"
$height = "180"
$width = "275"
$false = 0
$true = -1
If $title = ""
$title = "SQL PASSWORD UTLILTY"
endif

$html = '
<html><head>
<title>$title</title>

<style>
<!---body{ background-color: silver; color: black;font-family: tahoma, arial; font-size:
10pt; margin: 3px "input.tbox { border: lpx black solid;}td { font: 10pt tahoma; }--->
</style></head>

<body scroll=no onresize="window.resizeto(240,120);">

<table align=center>
<form name=frm>
<tr>
<td align=right>Current: </td>
<td colspan=2><input id=password0 type=password value="" class=tbox></td>
</tr>
<tr>
<td align=right>Password: </td>
<td colspan=2><input id=password1 type=password value="" class=tbox></td>
</tr>
<tr>
<td align=right>Confirm: </td>
<td colspan=2><input id=password2 type=password value="" class=tbox></td>
</tr>
<tr>
<td><input id=reset type=button value=" Submit "

onclick="frm.status.value=1"><input type=hidden id=status name=status value=0></td>
<td align=right><input id=close type=button value=" Cancel "

onclick="frm.status.value=2"></td>
</tr>
</form>
</table></body></html>'

:Closed_Window
$ie = CreateObject("internetexplorer.application")
; Set properties and display form ...
$ie.addressbar = $false
$ie.menubar = $false
$ie.toolbar = $false
$ie.statusbar = $false
$ie.resizable = $false
$ie.top = $top
$ie.left = $left
$ie.height = $height
$ie.width = $width
$ie.visible = $true

$ie.navigate("about:blank")

while $ie.busy <>0 and @error = 0 loop

; Get a handle to the open document ...
$doc = $ie.document
$doc.write($html)
while setfocus("$title") <> 0 loop

$status = $doc.GetElementById("status")
$password0 = $doc.GetElementById("password0")
$password1 = $doc.GetElementById("password1")
$password2 = $doc.GetElementById("password2")

while @error = 0 and $status.value <> ""
select
case $status.value = "1"
;submit was clicked
Select
case $password1.value <> $password2.value
$nul = Messagebox("Passwords do not match",

"ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
case $password1.value = "" or $password2.value = ""
$nul = Messagebox("Blank passwords are not

allowed", "ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
case $case = 1
if $password1.value == $password2.value
$GUIPassPrompt = $password1.value
$GUIPassPromptOld = $password0.value
$ie.quit()
exit
else
$nul = Messagebox("Passwords do not

match", "ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
endif
case $case = 0
if $password1.value = $password2.value
$GUIPassPrompt = lcase($password1.value)
$ie.quit()
exit
else
$nul = Messagebox("Passwords do not

match", "ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
endif

endselect

$status.value = 0
case $status.value = "2"
;cancel was clicked
if $force = "1"
$nul = Messagebox("You Must Change your password!",

"ERROR",4144)
else
$ie.quit()
exit(1067)
endif
$status.value = 0
endselect
loop
if $force = "1"
$nul = Messagebox("You Must Change your password!", "ERROR",4144)
goto Closed_Window
else
$ie.quit()
exit
endif

endfunction

_________________________
Austin Henderson

Top
#26855 - 2002-08-10 05:24 PM Re: vbs -> Kix
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
hey guys.

I tested GUIPassPrompt with kix4.10 and 4.11 beta 2. Both test using the code found here GUIPassPrompt were ok.
(ok this version is not the same version here.... sorry)

Austin,

I found the bug in this version of GUIPassPrompt

code:
function GUIPassPrompt($case, $force, optional $title)
;This is a GUI password Prompt.
; Syntax:
; GUIPassPrompt(Case Sensetive[0/1] | force[0/1] | Optional Title )
; Case Sensetive [0,1]
; 0 = ignore case
; 1 = all password are case sensitive
;
; Force [0,1]
; "0" will not force a password
; "1" will force the user to enter a password
;
; Title(optional) "Your title here"
; Defalut title = "Please enter your password."
; set this option to change it.
;
;Example:
; ;This will show a non case sensetive password prompt with the default title and not forced
; $password = GUIpassprompt(0,0)
;
; ;this is a forced case sensetive password prompt with the title "Enter your password"
; $password = GUIPassPrompt(1,1,"Enter your password")

DIM $title, $case, $top, $left, $height, $Width, $False, $true
DIM $status, $Password1, $password2, $doc, $nul, $html
global $GUIPassPromptOld

$password = ""
$top = "100"
$left = "200"
$height = "180"
$width = "275"
$false = 0
$true = -1
If $title = ""
$title = "SQL PASSWORD UTLILTY"
endif

$html = '
<html><head>
<title>$title</title>

<style>
<!---body{ background-color: silver; color: black;font-family: tahoma, arial; font-size:
10pt; margin: 3px "input.tbox { border: lpx black solid;}td { font: 10pt tahoma; }--->
</style></head>

<body scroll=no onresize="window.resizeto(240,120);">

<table align=center>
<form name=frm>
<tr>
<td align=right>Current: </td>
<td colspan=2><input id=password0 type=password value="" class=tbox></td>
</tr>
<tr>
<td align=right>Password: </td>
<td colspan=2><input id=password1 type=password value="" class=tbox></td>
</tr>
<tr>
<td align=right>Confirm: </td>
<td colspan=2><input id=password2 type=password value="" class=tbox></td>
</tr>
<tr>
<td><input id=reset type=button value=" Submit " onclick="frm.status.value=1"><input type=hidden id=status name=status value=0></td>
<td align=right><input id=close type=button value=" Cancel " onclick="frm.status.value=2"></td>
</tr>
</form>
</table></body></html>'

:Closed_Window
$ie = CreateObject("internetexplorer.application")
; Set properties and display form ...
$ie.addressbar = $false
$ie.menubar = $false
$ie.toolbar = $false
$ie.statusbar = $false
$ie.resizable = $false
$ie.top = $top
$ie.left = $left
$ie.height = $height
$ie.width = $width
$ie.visible = $true

$ie.navigate("about:blank")

while $ie.busy <>0 and @error = 0 loop

; Get a handle to the open document ...
$doc = $ie.document
$doc.write($html)
while setfocus("$title") <> 0 loop

$status = $doc.GetElementById("status")
$password0 = $doc.GetElementById("password0")
$password1 = $doc.GetElementById("password1")
$password2 = $doc.GetElementById("password2")

while @error = 0 and $status.value <> ""
select
case $status.value = "1"
;submit was clicked
Select
case $password1.value <> $password2.value
$nul = Messagebox("Passwords do not match", "ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
case $password1.value = "" or $password2.value = ""
$nul = Messagebox("Blank passwords are not allowed", "ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
case $case = 1
if $password1.value == $password2.value
$GUIPassPrompt = $password1.value
$GUIPassPromptOld = $password0.value
$ie.quit()
exit
else
$nul = Messagebox("Passwords do not match", "ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
endif
case $case = 0
if $password1.value = $password2.value
$GUIPassPrompt = lcase($password1.value)
$GUIPassPromptOld = $password0.value
$ie.quit()
exit
else
$nul = Messagebox("Passwords do not match", "ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
endif

endselect

$status.value = 0
case $status.value = "2"
;cancel was clicked
if $force = "1"
$nul = Messagebox("You Must Change your password!", "ERROR",4144)
else
$ie.quit()
exit(1067)
endif
$status.value = 0
endselect
loop
if $force = "1"
$nul = Messagebox("You Must Change your password!", "ERROR",4144)
goto Closed_Window
else
$ie.quit()
exit
endif

endfunction


Top
#26856 - 2002-08-10 06:03 PM Re: vbs -> Kix
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
so you are stating I have a bad version of GUIPassPrompt ()... I got it from the udf section. I suppose I did something wrong.. I will take a look at it.. I did add the current field to the html... perhaps I screwed something up.
_________________________
Austin Henderson

Top
#26857 - 2002-08-10 06:21 PM Re: vbs -> Kix
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
austin, when there is udf which is failing, just blame the author, not yourself.

anyway, can't test any of your or bryce's code...
so, if bryce says it's fixed, check that one currently on udf-forum. if it's the same, there is also one on bryce's site.
get the newist one and check with that.

if no worky, blame the author [Big Grin]

anyway, this can't be so hard, we just have to find the little "flaws" we are having there...
_________________________
!

download KiXnet

Top
#26858 - 2002-08-10 09:47 PM Re: vbs -> Kix
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Guys:

Since I wrote all those DB...() UDFS I can only say that they were written for KiXtart 4.02. I have not yet tested them with KiXtart 4.10+, I have not yet found the time to do this. According to the error generated it does seem to have to do with the DB function and the object. Maybe its the change that objects now have default properties or something like this?

Anyway, I'll put it on my TO-DO list and might have time for it tomorrow if I can get my 'Accounting' paper finished.
_________________________
There are two types of vessels, submarines and targets.

Top
#26859 - 2002-08-11 04:34 PM Re: vbs -> Kix
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
I am thinking the problem is in GUIPassPrompt () because I modified it to return $GUIPassOld... I added that code.. my code works fine in 4.02 but whatever I did doesnt work in 4.1.. the reason I think it is failing is because the old $GUIPassOld is not being returned to the main calling program.. I am leaving now for vacation and will get back into it when I return.

Thank you all for your help.
_________________________
Austin Henderson

Top
#26860 - 2002-08-18 08:40 PM Re: vbs -> Kix
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Is there a change in the new version of kix that woudl not allow me to set a value in a UDF and then use that value in the main calling program? That is the only trouble I can find.. I am wondering the correct way to do this. Thank you..
_________________________
Austin Henderson

Top
#26861 - 2002-08-18 08:43 PM Re: vbs -> Kix
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
there is no such change.

anyway, what are you strucling currently on?
the same problem or did you get over it already?
_________________________
!

download KiXnet

Top
#26862 - 2002-08-18 08:50 PM Re: vbs -> Kix
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
same problem just got back from vacation..

I am testing and finding that the GUIPassPrompt () udf is not returning $GUIPassOld I am confused as to why this is... udf is now

code:
 function GUIPassPrompt($case, $force, optional $title)
;This is a GUI password Prompt.
; Syntax:
; GUIPassPrompt(Case Sensetive[0/1] | force[0/1] | Optional Title )
; Case Sensetive [0,1]
; 0 = ignore case
; 1 = all password are case sensitive
;
; Force [0,1]
; "0" will not force a password
; "1" will force the user to enter a password
;
; Title(optional) "Your title here"
; Defalut title = "Please enter your password."
; set this option to change it.
;
;Example:
; ;This will show a non case sensetive password prompt with the default title and not forced
; $password = GUIpassprompt(0,0)
;
; ;this is a forced case sensetive password prompt with the title "Enter your password"
; $password = GUIPassPrompt(1,1,"Enter your password")

DIM $title, $case, $top, $left, $height, $Width, $False, $true
DIM $status, $password0, $password1, $password2, $doc, $nul, $html

$password = ""
$top = "100"
$left = "200"
$height = "180"
$width = "275"
$false = 0
$true = -1
If $title = ""
$title = "SQL PASSWORD UTLILTY"
endif

$html = '
<html><head>
<title>$title</title>

<style>
<!---body{ background-color: silver; color: black;font-family: tahoma, arial; font-size:
10pt; margin: 3px "input.tbox { border: lpx black solid;}td { font: 10pt tahoma; }--->
</style></head>

<body scroll=no onresize="window.resizeto(240,120);">

<table align=center>
<form name=frm>
<tr>
<td align=right>Current: </td>
<td colspan=2><input id=password0 type=password value="" class=tbox></td>
</tr>
<tr>
<td align=right>Password: </td>
<td colspan=2><input id=password1 type=password value="" class=tbox></td>
</tr>
<tr>
<td align=right>Confirm: </td>
<td colspan=2><input id=password2 type=password value="" class=tbox></td>
</tr>
<tr>
<td><input id=reset type=button value=" Submit " onclick="frm.status.value=1"><input type=hidden id=status name=status value=0></td>
<td align=right><input id=close type=button value=" Cancel " onclick="frm.status.value=2"></td>
</tr>
</form>
</table></body></html>'

:Closed_Window
$ie = CreateObject("internetexplorer.application")
; Set properties and display form ...
$ie.addressbar = $false
$ie.menubar = $false
$ie.toolbar = $false
$ie.statusbar = $false
$ie.resizable = $false
$ie.top = $top
$ie.left = $left
$ie.height = $height
$ie.width = $width
$ie.visible = $true

$ie.navigate("about:blank")

while $ie.busy <>0 and @error = 0 loop

; Get a handle to the open document ...
$doc = $ie.document
$doc.write($html)
while setfocus("$title") <> 0 loop

$status = $doc.GetElementById("status")
$password0 = $doc.GetElementById("password0")
$password1 = $doc.GetElementById("password1")
$password2 = $doc.GetElementById("password2")

while @error = 0 and $status.value <> ""
select
case $status.value = "1"
;submit was clicked
Select
case $password1.value <> $password2.value
$nul = Messagebox("Passwords do not match", "ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
case $password1.value = "" or $password2.value = ""
$nul = Messagebox("Blank passwords are not allowed", "ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
case $case = 1
if $password1.value = $password2.value
$GUIPassPrompt = $password1.value
$GUIPassOld = $password0.value
$ie.quit()
exit
else
$nul = Messagebox("Passwords do not match", "ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
endif
case $case = 0
if $password1.value = $password2.value
$GUIPassPrompt = lcase($password1.value)
$ie.quit()
exit
else
$nul = Messagebox("Passwords do not match", "ERROR",4144)
$password0.value = ""
$password1.value = ""
$password2.value = ""
endif

endselect

$status.value = 0
case $status.value = "2"
;cancel was clicked
if $force = "1"
$nul = Messagebox("You Must Change your password!", "ERROR",4144)
else
$ie.quit()
exit(1067)
endif
$status.value = 0
endselect
loop
if $force = "1"
$nul = Messagebox("You Must Change your password!", "ERROR",4144)
goto Closed_Window
else
$ie.quit()
exit
endif

endfunction

_________________________
Austin Henderson

Top
#26863 - 2002-08-18 08:59 PM Re: vbs -> Kix
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Well gentlemen... I am an idiot as usually happens in my posts. It is because I did not modify the case option in the UDF.. I was only setting the variable if case =1 I was passing case =0. Thus my returning password problem has been resolved.. now I can work forward with the original one...

Man I hate it when that happens...
_________________________
Austin Henderson

Top
#26864 - 2002-08-18 09:31 PM Re: vbs -> Kix
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Now that I have the stupid variable problem fixed I am still having trouble making the DBExecuteSQL() execute. Using the following code I still get the same error (error is -2147352567). Not sure where to go from here but to wait for UDF author to fix.

Thanks

code:
 $NEWPWD = guipassprompt(1,0)		;Call code to get password
if ingroup ("TMT User") or ingroup ("TMW User")=0
$ConnDSN = "DRIVER={SQL Server};SERVER=TRINITY;UID=@UserId;PWD=$GUIPassOld;"
$objConn = DBConnOpen($ConnDSN,,)
while @error
$nul = Messagebox("- CURRENT PASSWORD INCORRECT -", "ERROR",4144)
$NEWPWD = guipassprompt(0,0) ;Call code to get password
$ConnDSN = "DRIVER={SQL Server};SERVER=TRINITY;UID=@UserId;PWD=$GUIPassOld;"
$objConn = DBConnOpen($ConnDSN,,)
loop
$SQL = "sp_password NULL,'$NEWPWD','@UserID'"
$SQLExe = DBExecuteSQL($objConn,$sql,)
if @error <> 0
"Error: "@error
$nul = Messagebox("- ERROR CONTACT ADMIN -", "ERROR",4144)
else
$nul = Messagebox("- PASSWORD CHANGED -", "ALERT",4160)
endif
$close = DBConnClose($objConn)
endif

_________________________
Austin Henderson

Top
#26865 - 2002-08-18 09:34 PM Re: vbs -> Kix
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
I could add that I am sure it is bombing at $rsRecordset=$cmdCommand.Execute() in the UDF. Back to the original issue which is to make use of wkix32 is there an older version of wkix32 that I could use that may get me around the problem? How about a way to include kix32 in the kixcrypt crytped file so it will run on its own.. possible?

code:
function DBExecuteSQL($objConn, $sql, optional $cmdType)
dim $cmdCommand, $rsRecordset
dim $adCmdUnspecified, $adCmdText, $adCmdTable, $adCmdStoredProc, $adCmdUnknown, $adCmdFile, $adCmdTableDirect

$adCmdUnspecified = -1
$adCmdText = 1
$adCmdTable = 2
$adCmdStoredProc = 4
$adCmdUnknown = 8
$adCmdFile = 256
$adCmdTableDirect = 512

if vartype($cmdType)
$cmdType=val($cmdType)
else
$cmdType=$adCmdText
endif

if vartype($objConn)<>9 or $sql=''
exit 87
endif

$cmdCommand = CreateObject('ADODB.Command')
if @ERROR
exit @ERROR
endif

$cmdCommand.ActiveConnection = $objConn
if @ERROR
exit @ERROR
endif

$cmdCommand.CommandType = $cmdType
if @ERROR
exit @ERROR
endif

$cmdCommand.CommandText = $sql
if @ERROR
exit @ERROR
endif

$rsRecordset=$cmdCommand.Execute()
if @ERROR
exit @ERROR
endif
$cmdCommand=''
$rsRecordset=''
$DBExecuteSQL=@ERROR

endfunction

_________________________
Austin Henderson

Top
Page 3 of 3 <123


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 194 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.114 seconds in which 0.066 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org