|
I am writing this Vb
<br />
strSQLUpdate = "SELECT PassID From Users WHERE (PassID)= " & SearchSQlPassID & " AND (Today_Date)=Date()" <--- works Sweet :)<br />
<br />
'open Connection<br />
strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\RMSC LOGIN\MYDataBase.mdb;Persist Security Info=False"<br />
Set Cnxn = New ADODB.Connection<br />
Cnxn.Open strCnxn<br />
Set cmdChange = New ADODB.Command ' Create command object<br />
Set cmdChange.ActiveConnection = Cnxn<br />
cmdChange.CommandText = strSQLUpdate<br />
Set rsUser = cmdChange.Execute ' execute the SQL command<br />
Now i want to test the value of the results
<br />
If rsUser.Fields("PassID").Value = 0 Then <-- error here Error 3021 either BOF or EOF is true or the record has been deleted<br />
if the passid doesn't meet the criteria above i want it to display a message
<br />
MsgBox ("You first need to log In before you log out!!")<br />
Cnxn.Close ' Close everything<br />
Set Cnxn = Nothing<br />
Unload Me<br />
how can I test the result without throwing this error?
|
|
|
|
|
Stupid Me !!!!!!!!
why didn't I try
<br />
if rsUser.BOF then <br />
MsgBox ("You first need to log In before you log out!!")<br />
Cnxn.Close ' Close everything<br />
Set Cnxn = Nothing<br />
Unload Me<br />
else <br />
the rest of my code to log the user out
Thanks for the help!! Some times it is neededc to have a different set of eyes looking at the code
|
|
|
|
|
Hi,
I want to write a program in vb by which the user can zip or unzip the selected files without opening winzip.
How i can do that in vb. if any of you have any idea or source code please tell me.
Thanks
Syed Saba
|
|
|
|
|
Do a quick google on the subject, there seem to be quite a few, also search the archives here, there are some examples that may help:
.net zip component - google[^]
Hope this helps
Tom
|
|
|
|
|
Actullay i want to use winzip in my visual basic program and through that i want to zip or unzip html files.
so i want to know how i can use winzip in my vb program through coding.
|
|
|
|
|
Yea, what you are looking for is a component that you can reference in your VB project; this will expose an object that you can use to zip/unzip files.
|
|
|
|
|
Yor are right i am looking for the same thing
|
|
|
|
|
Check out SharpZipLib[^]. To quote the author, #ziplib (SharpZipLib, formerly NZipLib) is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
How can i make a new form showing the positions of each racer (descending order), i have no idea how to do this as it is all new to me. My existing program is below:
http://www.angelfire.com/mech/harrysk/Assign1_Race.zip[^]
I want the race results after the race has finished, showing the Positions (descending), Name and Distance that they have travelled. Thanks in advance.
|
|
|
|
|
Have a crack at it, then we'll help on the specifics if you get stuck, rather than just writing your program for you.
|
|
|
|
|
This reeks of homework...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Not very clever, adding a link to a site that says explicitly Angelfire does not allow direct linking
from offsite, non-Angelfire pages, to files hosted on Angelfire..
Oh yes, Assign1_Race? The point of assignments is to put into practice what you learn't in the lessons, so you may find life easier if you pay attention to your teacher!
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
i have mdiform and i want when user open new form i close the old on i used vb6
|
|
|
|
|
I have created race game application (see project attachment: open zip file below), first off sometimes it works sometimes it doesn't, when it does work some problems still occur. The problems i am facing are:
1. why does it not change the rate of the accelelration, deceleration of each contestant when i enter it into their text boxes? (refer to project code-below)
2. when i click on restart and try to run it again all the vehicles disappear???
3. the cars already have default values (all different) so why do they run at the same speed, rate etc. (they all move at the same speed in a row, this always changes with the timer interval i enter into a text box, why?)
4. When i click on the start button the vehicles go out of the screen (down) and start to come up (start the race to see)
There may be more minor problems but i'll post them later if i have time (i got till the morining of 17th, so could someone please reply soon.) I need help on these small problems. Thanks.
Click on this link to download the project (zipped)
http://www.angelfire.com/mech/harrysk/Assign1_Race.zip[^]
|
|
|
|
|
Thought it smelt like homework, see next posting, same applies.
|
|
|
|
|
This may be possible through the windows registry but I don't have a clue on how to fetch those strings/value in hierarchal way.
|
|
|
|
|
Hiya.
Got an easy question here I think
Is it possible to pass an Array into a function withouth having to "dim" the array before hand.
For instance something like this:
Public Function Name(byval inputArray as string())
//some code
End Function
Now if I were to call that function I'd dim the array and assign the values:
dim objArray as String() = {"value", "value" ... "value"}
and then call the function:
Name(objArray)
However - what I'd really like to call the function similar as this:
Name( {"value", "value", ... , "value" } )
That is calling the function withouth having to dim the array.
Is there anyway something similar is possible?
Yes - I know it is a few lines of codes, but I'd still like to know.´
With regards
Alsvha
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
No it's not. You must Dim the variable first, otherwise VB will not know how to pass the variable to the function. Also, If your going to return values in the variable you pass in the function parameters, you must pass it ByRef, not ByVal.
Dim inputArray As String()
MyFunction(inputArray)
.
.
.
Public Sub MyFunction(ByRef ia As String())
ReDim ia(someNumber)
End Sub
Or, you could do it as a return value from a Function:
Dim inputArray As String()
inputArray = MyFunction(someValue)
.
.
.
Public Function MyFunction(ByVal value) As String()
Dim ia As String()
Return ia
End Sub
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
As said in the other post, you probably want to pass the parameter by Ref or return a value.
However it is possible to call a function or sub with the array declaration inline, as it were.
MyFunction(New Object() {Object1, Object2, Object3})
Another method that I prefer is to use a ParamArray as the parameter. This would give the following.
Public Sub MyMethod(ByVal ParamArray args() As Object)
' Do Stuff
End Sub
...
MyMethod(Object1, Object2, Object3)
Using this style you can pass the elements of the array as if they were parameters, and it still acts like an array.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
Is there a way that one can call a web service asynchonously (from a windows application, for example), be able to continue processing user input whilst waiting for the web service response, and be able to specify a timeout? I have previously used asyncCallBack, which allows an application to carry on working whilst waiting for the response from a web service, but it doesn't allow one to specify a timeout. One can use waitHandles, but I don't believe they offer that same flexibilty for the processing the application can carry out whilst it awaits a response. Any ideas?
|
|
|
|
|
|
Thanks, I'll have a look.
|
|
|
|
|
I Had an xml file that had a table in it.table0
I have recently added another. table1.
now when I run my program it says there are multiple root elements Line 10,position 2. does this mean i need to use SQL. if so or if not can someone type some sample code that would stop the root element problem. If you need to see my code I have another thread posted under datagrid/xmlfile that i posted yesterday and is on the next page.
|
|
|
|
|
The clue is in the error... i am guessing your original file was something like this:
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
Now i am guessing that you have a second table it looks something like this:
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
The problem is the two Table nodes in the root, therefore you need to put in a single root element:
<Tables>
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
</Tables>
Hope this helps
Tom
|
|
|
|
|
I want to prompt user for internet connection wizard if he is not connected.
how it can be done?
|
|
|
|