|
The filesystem object is part of the microsoft scripting runtime.
You can either add a reference to 'Microsoft Scripting Runtime' which will allow you to use early binding and intellisense or not bother with the reference and create it on the fly eg
set fsotest = creatobject("scripting.filesystemobject")
Jonathan
|
|
|
|
|
Hi jonathan,
Thanks for your reply, it really helped me a lot.
P.Madhu
Programmer
NSDRC
visakhapatnam-17
|
|
|
|
|
Im creating a login form for and administrator and a user. How would I make restrictions for the user using a module.
|
|
|
|
|
Your entire application has to be written with your security scheme in mind. You can't just add a little module and expect it to work. You haven't supplied any details about how you want your security scheme to work or what you need it for, so it's impossible to tell you what to do.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Well I have 4 different forms and a login form for the user and the admin. If the user logs on I want to be able to restrict them from accessing certain forms.
|
|
|
|
|
So what's wrong with checking the users access level when the user selects whatever option needed to create the new form? You'll need to check this for EVERY way to create the new forms. Or, you can even enable/disable certain controls on the form depending on the access level.
Security needs to be designed in before you even write the 1st line of code. You can't just slap this on as an after-thought and expect it to work.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i am trying to get started with some api calls in VB6.
i have found the declarations for the API calls, but don't know how to get the windows handle so that i can get the HDC to get everything else.
thank you
|
|
|
|
|
You can get windows hWnd's from the FindWindowEx API. The Spy++ utility tool installed with Visual Studio is indispensible for determining search criteria to find a specific window, because to find a child window handle you must first find it's parent window, and often the window you are looking for may be nested under several or more "generations" of parent handles.
Robert
|
|
|
|
|
You can use rwestgraham's method to get the window handle, or you can do it the easy way and just use the value that's in the form's hWnd property.
Dim windowHandle As Long
windowHandle = Form1.hWnd
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks for the easy way to get the handle to the app form.
what I'm trying to do in my app is dynamically size the label.width of a prompt and the text.left of the data next to it, that the user edits. i believe i need to get the TextMetrics for the selected font to calculate the widths and left positions. There's probably an easier way to do this too.
+----------+--------+
|first label: |first text|
+----------+--------+
+-------------+-----------+
|second label: |second text|
+-------------+-----------+
|
|
|
|
|
The GetTextExtentPoint32 API will return the length of a string in points, which can then be converted to pixels or other units to size a Textbox control to fit the text. You can easily size a Label control to fit it's text by simply setting the AutoSize property to True.
Robert
|
|
|
|
|
I also want to run my program from a cd, any suggestions?
rives
|
|
|
|
|
I'm trying to add a tab control to my form, and I did that, now i need to code it, does anyone have any sample code for that form.
rives
|
|
|
|
|
Hi!
What do you mean by code it?Add TabPages?
Create a TabPage objects, assign some text to the Text property and then do TabControl.Controls.Add(myTabPage) and the tabControl will have a new tabPage.And so on...
dim myTabPage as New TabPAge
myTabPage.Text = "Tab1"
(...)
myTabControl.Controls.Add(myTabPage)
Never say never
|
|
|
|
|
|
looks very critical problem...
|
|
|
|
|
or very critical boy
moreover it's his first post !!!!
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Does anyone know how i can calculate the average of all the integers in a column in a SQL table using vb code?
|
|
|
|
|
this sql statement will do the trick...
SELECT AVG(int_column) FROM your_table
// TODO: Write code.
|
|
|
|
|
This is exactly what i needed but i have a few questions.
does the "int" in int_column have to be there?
How do i get this value through code and save it to a variable?
How do i display this average value in a textbox or messagebox?
|
|
|
|
|
No, int_column was what I used to mean your Integer Column.
And for the rest of it...
<br />
Imports System.Data.SQLClient<br />
...<br />
Dim conn as SQLConnection<br />
Dim cmd as SQLCommand<br />
Dim str as String<br />
<br />
conn = New SQLConnection("server=localhost;uid=sa;pwd=;database=yourdb")<br />
conn.Open()<br />
cmd = new SQLCommand("SELECT AVG(int_column) FROM table")<br />
str = cmd.ExecuteScalar().ToString()<br />
<br />
MessageBox.Show(str)<br />
I don't know if that is exactly right, but it's a good place to start from. Here is some light reading to fill in the blanks.[^]
// TODO: Write code.
|
|
|
|
|
That is exactly what i needed.
Thank you
|
|
|
|
|
Does anyone have any experience with msgboxresult
I have a yes or no message box that comes up when the user
clicks the Delete All button. When they click yes i want to run
my DeletAll() sub but if they click no i do not want anything to happen.
Here is my code but when i run it, it will delete all no matter which button
i push.
msgbox("Are you sure you want to delete all records? ", msgboxstyle.YesNo, "Delete All Records?")
If msgboxresult.yes then
DeleteAll()
Else
Exit Sub
End If
|
|
|
|
|
Yeah here you go:
<br />
If msgbox("Are you sure you want to delete all records? ", msgboxstyle.YesNo, "Delete All Records?") = msgboxresult.yes then<br />
DeleteAll()<br />
Else<br />
Exit Sub<br />
End If <br />
OR
<br />
Dim msgRes as msgboxresult<br />
msgRes = msgbox("Are you sure you want to delete all records? ", msgboxstyle.YesNo, "Delete All Records?")<br />
<br />
If msgRes = msgboxresult.yes then<br />
DeleteAll()<br />
Else<br />
Exit Sub<br />
End If <br />
// TODO: Write code.
|
|
|
|
|
Thank you, i didnt think of doing it that way.
I actually ended up doing it like this
select case msg(...............)
case msgboxresult.yes
DeleteAll()
case msboxresult.no
end case
|
|
|
|