|
thanks for reply but there is no close function
|
|
|
|
|
http://www.thescripts.com/forum/thread351659.html[^] I found this with google. Looks like when you open a file, the object that opens the file should have a close function.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am creating a program that generates random numbers, in an attempt to simulate dice. i used to know how to do random numbers, but i forgot and i lost the project that i made with randoms. i have tried looking everywhere for an answer to my problem, but i always come up with an answer for c++, but i use VB.
i have decent VB programming skills (for a 15 year old that is learning VB in high school from an incompetent boob who thinks he knows VB better then me, yet he doesnt know the difference between a function procedure and a sub procedure) and i have made many programs, none of which are very useful, except for killing time and helpin gme with simple math. lol
plz help me wiht my random numbers problem!
|
|
|
|
|
Dim rnd as new Random()
dim n as int = rnd.Next(5)
Assuming this is VB.NET, and if it's not, why not ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
OK, then I'd suggest you spend some time learning how to build a google search:
http://www.google.com.au/search?sourceid=navclient&ie=UTF-8&rlz=1T4ADBS_enAU225AU226&q=vb%2enet+random[^]
But, what I said is roughly right ( syntax may be off, I don't use VB ). Create a random object and call Next to get numbers within the range you specify
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
google turns up way too much crap that i dont want.
thanks anyway!
|
|
|
|
|
philphan55 wrote: google turns up way too much crap that i dont want.
Again, only because you've not worked out how to use it
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Would be a great subject for an artile: "So you're goin' to... use Google."
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Hi!
I am able to create a word document. However I want to embed it in my form instead of lunching the MS word application. I don't know how to do that. Any help will be appreciated.
Thanks.
Juneyt
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Hello Juneyt,
You may use a web browser control; load the document into the browser. The link below explains how:
http://support.microsoft.com/?scid=kb;EN-US;304643
Regards,
Dave
Dave Traister
Software Engineer
ComponentOne LLC
www.ComponentOne.com
|
|
|
|
|
I have a frmLogin to my application that after authentication, users get to frmMain. There are 2 buttons - button1 and button2 that I want to be only accessible to Administrations. How do I code this so that when I non administrator clicks on these buttons they get a message saying "access denied" or gray out these buttons and not allow clicks?
TIA
|
|
|
|
|
To disable the controls, all you need to do is set the Enabled property of each control to False. This turns the controls gray so the user can't click on them.
How are you checking to see if the user is an Administrator or not?? Is this depending on the user's Windows account or are you using your own user accounts and creating your own security system??
|
|
|
|
|
Thanks. I am using my own securty system to validate users; that works fine. The piece that was missing for me is the management of the Controls. regards.
|
|
|
|
|
I take it you've got it figured out now? I mean you were missing the Enabled property??
|
|
|
|
|
Dave thanks for your guidance on figuring this out. Basically, I dimmed the frmlogin in my frmmain and use the login credentials to determine whether or not to "Me.btnMaintainEmployees.Enabled = False". This works great. Thanks again.
|
|
|
|
|
Hello Everyone,
I am trying to code a program in VB6 where i have a DLL. My aim is to call some functions from the dll. I am totally new to this VB envoirnment and hence require some help. Actually this is a part of PHP project which is to be interfaced with some other application through this dll. The dll guys gave this code and i simply copy pasted this code in VB application. The minute i compile the code i get an error "Constants, fixed length strings, arrays, user-defined types and declare statements not allowed as public members of object modules."
This is the part of the code, i am getting error on the very first line of the code.
Option Explicit
Declare Function RTSOpen Lib "RTSLINK.DLL" Alias "Open" () As Long
Declare Function Send Lib "RTSLINK.DLL" (ByVal strRequestXML As String) As Long
Declare Function GetLastErrorMessage Lib "RTSLINK.DLL" () As String
Public Sub vbSend()
Dim nResult As Integer
Dim strErrorMsg As String * 255
Dim strRequestXML
Dim strResponseText
....
Regards,
Chaitannya
|
|
|
|
|
What kind of project did you create?? What file is this code being pasted into??
Mind you, it's been about 7 years since I last used VB6, so my memory may fail me at any point...
|
|
|
|
|
A simple exe project, copy pasted the code in the Form page.
|
|
|
|
|
Hmmm... It would appear that somewhere along the line there is code outside of a function/sub that can only work inside a function/sub. This is anything that isn't a declaration.
It's also possible that some of the code you were given will only work if pasted into a Module, not a form.
|
|
|
|
|
Hi
I am developing windows based application ...
write this code to fill the datagridview.....
i am getting error at fill that
<br />
<br />
If con.State = ConnectionState.Open Then con.Close()<br />
con.Open()<br />
Dim sqlcommand1 As New SqlClient.SqlCommand("usp_FillVS", con)<br />
sqlcommand1.CommandType = CommandType.StoredProcedure<br />
sqlcommand1.Parameters.Add("@ApplicationNumber", SqlDbType.BigInt).Value = ApplicationNumber<br />
sqlcommand1.ExecuteNonQuery()<br />
Dim GDataAdapter As New SqlClient.SqlDataAdapter<br />
GDataAdapter.Fill(GDataSet, "Outbound_Data")<br />
DataGridView1.DataSource = GDataSet<br />
<br />
|
|
|
|
|
Hi,
As u have not set any sql command for GDataAdapter u r getting that error.....
Regards,
Sandeep Kumar.V
|
|
|
|
|
Hi,
Thanks for your kind reply.
code is executed without any error but data is not displayed...
i am working on window based application previously i work on web application so on simple thing i find difficult.
<br />
If con.State = ConnectionState.Open Then con.Close()<br />
con.Open()<br />
Dim sqlcommand1 As New SqlClient.SqlCommand("usp_FillVS", con)<br />
sqlcommand1.CommandType = CommandType.StoredProcedure<br />
sqlcommand1.Parameters.Add("@ApplicationNumber", SqlDbType.BigInt).Value = ApplicationNumber<br />
sqlcommand1.ExecuteNonQuery()<br />
'dataReader = sqlcommand1.ExecuteReader<br />
Dim GDataAdapter As New SqlClient.SqlDataAdapter<br />
' OleDbDataAdapter myAdapter = new OleDbDataAdapter(myCommand); <br />
GDataAdapter = New SqlDataAdapter(sqlcommand1)<br />
GDataAdapter.Fill(GDataSet, "Outbound_Data")<br />
DataGridView1.DataSource = GDataSet<br />
|
|
|
|
|
Hi,
soniasan wrote: sqlcommand1.ExecuteNonQuery()
comment the above line and try to execute the code...
Regards,
Sandeep Kumar.V
|
|
|
|
|
Hi All,
I want to get USB PNPDeviceID from WMI or API using VB6 code. I have a code using .NET, but i need vb6 code.
Thanks & Regards
Kumaran
|
|
|
|