|
Thank you both for this option... It's definitely better than using the nested if...then...else statements... Should work nicely... Thanks again...
|
|
|
|
|
Hi all...
I am creating a program for a small company to store all informations about its product.
There are several branches of company in many cities. So this program will be used in several cities.
The main job I have to do is, if a person in city1 or city2 sell a product and print its bill, then that program will send all informations of that product(name,price,qty,date of purchasing and selling etc.) to the main program running on the system of manager of the company(in another city).
Please suggest me how can I do this...
Thanks.
Gagan
|
|
|
|
|
Sounds like another rentacoder job gone bad to me.....
Obviously you need a central database to manage this, and then I would say that a webservice you can call to report a sale is what you're after.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
can u tell me how can I use webservice call to send information.
Gagan
|
|
|
|
|
Well, you do it by calling the webservice. I assume you have no idea what a webservice is, did you google it and read up on what I'm talking about ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
'==========================================================================
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.1
'
' NAME:
'
' AUTHOR: OEM USER , OEM USER
' DATE : 12/15/2008
'
' COMMENT:
'
'==========================================================================
'Option Explicit
Dim strComputer, passLen, accName, inputFile, newpass
'-----------------------------------
passLen = 128
accName = "itdadmin"
strComputer = "."
'inputFile = strComputer
inputFile = "C:\COMPUTERS.TXT"
'-----------------------------------
newpass = generatePassword(passLen)
Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("c:\windows\system32\pspasswd.exe @" &chr(34) &inputFile &chr(34) &" " &accName &" " &newpass )
'Set objWshScriptExec = objShell.Exec("c:\windows\system32\pspasswd.exe @" &chr(34) &strComputer &chr(34) &" " &accName &" " &newpass )
'Set objStdOut = objWshScriptExec.StdOutstrOutput = objStdOut.ReadAll
WScript.Echo date & "," & time & VbCrLf&"NewPassword: "& newpass& vbCrLf& vbCrLf & strOutput
Set objShell = Nothing
wscript.quit
Function generatePassword(PASSWORD_LENGTH)
Dim NUMLOWER, NUMUPPER, LOWERBOUND, UPPERBOUND, LOWERBOUND1, UPPERBOUND1, SYMLOWER, SYMUPPER
Dim newPassword, count, pwd
Dim pCheckComplex, pCheckComplexUp, pCheckComplexLow, pCheckComplexNum, pCheckComplexSym, pCheckAnswer
NUMLOWER = 48 ' 48 = 0
NUMUPPER = 57 ' 57 = 9
LOWERBOUND = 65 ' 65 = A
UPPERBOUND = 90 ' 90 = Z
LOWERBOUND1 = 97 ' 97 = a
UPPERBOUND1 = 122 ' 122 = z
SYMLOWER = 33 ' 33 = !
SYMUPPER = 46 ' 46 = .
pCheckComplexUp = 0 ' used later to check number of character types in password
pCheckComplexLow = 0 ' used later to check number of character types in password
pCheckComplexNum = 0 ' used later to check number of character types in password
pCheckComplexSym = 0 ' used later to check number of character types in password
' initialize the random number generator
Randomize()
newPassword = ""
count = 0
DO UNTIL count = PASSWORD_LENGTH
' generate a num between 2 and 10
' if num < 5 create an uppercase
If Int( ( 10 - 2 + 1 ) * Rnd + 2 ) < 5 Then
pwd = Int( ( UPPERBOUND - LOWERBOUND + 1 ) * Rnd + LOWERBOUND )
' if num is between 4 and 7 create a lowecase
Elseif Int( ( 10 - 2 + 1 ) * Rnd + 2 ) > 3 And Int( ( 10 - 2 + 1 ) * Rnd + 2 ) < 8 Then
pwd = Int( ( UPPERBOUND1 - LOWERBOUND1 + 1 ) * Rnd + LOWERBOUND1 )
' if num is between 8 and 10 generate a symbol
Else
pwd = Int( ( SYMUPPER - SYMLOWER + 1 ) * Rnd + SYMLOWER )
End If
newPassword = newPassword + Chr( pwd )
count = count + 1
'Check to make sure that a proper mix of characters has been created. If not discard the password.
If count = (PASSWORD_LENGTH) Then
For pCheckComplex = 1 To PASSWORD_LENGTH
'Check for uppercase
If Asc(Mid(newPassword,pCheckComplex,1)) >64 And Asc(Mid(newPassword,pCheckComplex,1))< 90 Then
pCheckComplexUp = 1
'Check for lowercase
ElseIf Asc(Mid(newPassword,pCheckComplex,1)) >96 And Asc(Mid(newPassword,pCheckComplex,1))< 123 Then
pCheckComplexLow = 1
'Check for numbers
ElseIf Asc(Mid(newPassword,pCheckComplex,1)) >47 And Asc(Mid(newPassword,pCheckComplex,1))< 58 Then
pCheckComplexNum = 1
'Check for symbols
ElseIf Asc(Mid(newPassword,pCheckComplex,1)) >32 And Asc(Mid(newPassword,pCheckComplex,1))< 47 Then
pCheckComplexSym = 1
End If
Next
'Add up the number of character sets. We require 3 or 4 for a complex password.
pCheckAnswer = pCheckComplexUp+pCheckComplexLow+pCheckComplexNum+pCheckComplexSym
If pCheckAnswer < 3 Then
newPassword = ""
count = 0
End If
End If
Loop
'The password is good so return it
generatePassword = newPassword
End Function
|
|
|
|
|
bohicamaster wrote: How can I target the local system instead of using a txt file for a Ramdom Password Change to all computer system
Uhhh... what? I don't understand what you're trying to do. You're going to have to explain the process you're using, why you're using files, and why you want to "target the local system". What does "target the local system" mean?? What are you ultimately trying to do with this??
|
|
|
|
|
How can this ever be rated a "good answer"? it is nothing but more questions
|
|
|
|
|
Is there anything that I missed? I wanted to make sure there no doubt that I had no idea what he was trying to do. What do you think?
|
|
|
|
|
Dave Kreskowiak wrote: Is there anything that I missed?
You sure didn't miss another opportunity to ask more questions...
|
|
|
|
|
I have the following code that groups a generic List(Of T) that I want to order by IMRecord.BusinessUnit, but I can't get it to work. Can anyone help me with this?
Dim query = From IMRecord In ImRecordList _
Group By IMRecord.BusinessUnit, _
IMRecord.DocType, _
IMRecord.Description, _
IMRecord.VendorCode, _
IMRecord.DocDate, _
IMRecord.PONumber, _
IMRecord.DocNumber, _
IMRecord.Account _
Into Group, Purchases = Sum(CDec(IMRecord.Purchases)), _
Debit = Sum(CDec(IMRecord.Debit)), _
Credit = Sum(CDec(IMRecord.Credit)) _
Order By IMRecord.BusinessUnit
If I take off the Order By the grouping works ok.
|
|
|
|
|
Looks like the into is in the wrong place. SQL format (assuming that's being used?):
select
into
from
where
group by
order by
cheers!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Is it possible to create and instantiate a VB6 .dll in VB .Net without having a reference to the VB6 .dll? I tried to use the Assembly.LoadFrom method, which doesn't seem to work (and probably isn't intended for ActiveX .dlls).
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Can you just create an assembly with the name VB6.dll?
|
|
|
|
|
Uhhh... WHAT??
|
|
|
|
|
I love these forums. Sorry Dave, but I have to say, the VB one is the worst. People with no idea trying to answer questions, I assume b/c they think a CP MVP would help them get a job.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: I love these forums. Sorry Dave, but I have to say, the VB one is the worst. People with no idea trying to answer questions,
No kidding. Over the last 5 years, I've watched the quality of questions just plummet, most likely due to the outsourcing boom. Now, those same people think less than a years experience makes them qualified to write articles and answer questions.
This is why I don't trust anything I read on the web any more!
|
|
|
|
|
Yeah, I am sure that outsourcing is the problem. I am sure people are hired in parts of the world and given a desk, a PC, and the URL to our forums.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: I am sure people are hired in parts of the world and given a desk, a PC, and the URL to our forums.
After dealing with a few of these companies, I <seriously>wouldn't be surprised!</seriously>
|
|
|
|
|
|
Would you ever come up with a crack-smoking answer as the one that started this part of of the thread?
|
|
|
|
|
No
Or as a joke wich would be clearly marked with the joke icon (and perhaps even stated in the message and only if the question really warented it).
Have to admit my first reaction when I read his answer was the same as yours. And I do agree with your statement that the level of questions asked here has decreased exponentially.
But I guess this all comes down to that age old argument of generalization. Just because there are a few (ok I admit alot) off bad ones doesn't mean they all are. (I'v had my share of encounters with some of that kind aswell)
|
|
|
|
|
Dave Kreskowiak wrote: Would you ever come up with a crack-smoking answer as the one that started this part of of the thread?
Pass what he was smoking.........time to take a trip to la-la land.
Agreed on outsourcing and given a direct link to this and other forums.
This may sound awful, but I have a list of four “special” users I will never respond to because the questions they post are entirely to basic and never provide any specific work (IE: "I need to create a contact database using VB, how do I do that?"), or when you do give the OP the correct answer or links to suitable examples (often line by line nonetheless) - they always bash you on the score.
In all seriousness, I hope that my orig. question wasn’t too basic in nature. I tried to Google the answer, but kept finding the assembly.load examples which didn’t apply. If you find that one of my questions isn’t up to snuff, just let me know so that I can correct myself in the future.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Your question was actually a good one. It's just that first answer you got what a " " moment.
If the question is good and the poster has added enough detail to prove some research effort, I don't have a problem with answering those "basic" questions at all. It's the ones who don't know how to, or don't want to, do any research that really irks me. Then to have someone follow up with a wild, off-the-wall, totally stupid and unresearched answer like that ... wow. It doesn't do anyone any good if the answer is just a wild guess.
|
|
|
|
|
The question -
"Is it possible to create and instantiate a VB6 .dll in VB .Net without having a reference to the VB6 .dll? I tried to use the Assembly.LoadFrom method, which doesn't seem to work (and probably isn't intended for ActiveX .dlls). "
My answer -
"Can you just create an assembly with the name VB6.dll?"
Perhaps I should have said...
"Yes. Create a .NET assembly called VB6.dll and use that if you need an instance of the assembly by that name."
He never said he needed the functionality of the VB6.dll (why would he even want it?), and the question was so odd that I could not help myself with a minimalist effort and a bit of infamous NJ sarcasm.
So... now you can get the hell off me. Just because I don't have the MicrosoftsValuablePenis award in my sig doesn't mean I am any less capable or competent than any of you.
|
|
|
|
|