|
Hello Everyone,
I am wondering if it is possible to use F9, F10, F11, & F12 as a shortcut key in my web application. I know that IE reserves some of them, but the client would find it useful if we could apply them for the application purpose rather than using Alt+Character.
Has anyone accomplished this without using a 3rd party add-in product?
Thanks for the thoughts-in advance.
SD
|
|
|
|
|
Hi,
I'm trying to create a user interface using VB6 by querying data from MS Access 97.
The case is: For ID number 1, I have 5 transactions to be retrieve and displayed in a listview in VB.
'Sample Access table that I have
ID | Transaction | date
1 | test1 | Jan 01, 2006
1 | test2 | Jan 03, 2006
1 | test3 | Jan 04, 2006
1 | test4 | Jan 06, 2006
1 | test5 | Jan 07, 2006
2 | test7 | Jan 02, 2006
3 | test8 | Jan 03, 2006
4 | test9 | Jan 09, 2006
How can I retrieve the data, for ID number 1, all at once?
Thank you very much.
|
|
|
|
|
wliong wrote: The case is: For ID number 1, I have 5 transactions to be retrieve and displayed in a listview in VB.
http://www.freevbcode.com/ShowCode.Asp?ID=2607[^]
wliong wrote: How can I retrieve the data, for ID number 1, all at once?
SELECT [TableName].ID FROM [TableName] WHERE [TableName].ID = 1
|
|
|
|
|
As part of a new acceptance test checklist for our QA we want to add a check item to insuder that a release candidate has been compiled in release mode ad not in debug mode.
This raises an interesting question: Given a binary file (exe, dll, etc) is there a way to prove the build mode of the file?
Thanks!
--
E
|
|
|
|
|
I'm guessing we're talking about .NET assemblies (EXEs, DLLs) here.
The easiest method would be to have the .NET assembly check itself if it's in debug mode.
#If DEBUG
MessageBox.Show("I'm in debug mode!")
#End If
You can have your app check whether or not other .NET assemblies are in debug mode by doing this.
Dim myAssembly As System.Reflection.Assembly
Try
myAssembly = System.Reflection.Assembly.LoadFrom(".\MyAssembly.dll")
If (myAssembly.GetCustomAttributes(GetType(DebuggableAttribute), False).Length > 0) Then
MessageBox.Show("This is a debug version.")
Else
MessageBox.Show("This is a release version.")
End If
Catch
End Try
|
|
|
|
|
Hi,
I am new to .NET and having trouble writing the code to take values from all the text boxes in one Form and displaying it in Crystal Reports. Right now the report is connected to Access DB and I have dragged all the fields onto the report. Obviously when I run the report now it takes all the data from the DB and dumps it in the report. To make it display just the desired text boxes this is the code I have written but it does not work.
Any help would be appreciated.
Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load <br />
<br />
Dim rptdata As New dbAccess <br />
Dim rptval As New Change <br />
<br />
Dim LogNumber1 As Integer <br />
Dim Daterequested1 As String <br />
Dim TargetDate1 As String <br />
Dim Time1 As String <br />
Dim RequestedBy1 As String <br />
Dim ProjectName1 As String <br />
Dim ChangeDescription1 As String <br />
Dim Users1 As String <br />
Dim Department1 As String <br />
<br />
LogNumber1 = rptval.LogNumber <br />
Daterequested1 = rptval.DateRequested <br />
TargetDate1 = rptval.TargetDate <br />
Time1 = rptval.Time <br />
RequestedBy1 = rptval.RequestedBy <br />
ProjectName1 = rptval.ProjectName <br />
ChangeDescription1 = rptval.ChangeDescription <br />
Users1 = rptval.Users <br />
Department1 = rptval.Department <br />
<br />
CrystalReportViewer1.ReportSource = New Chgmgt <br />
<br />
End Sub
|
|
|
|
|
Hi all,
In VB6, is it possible to use a User Defined Type as the return parameter of a method class? I've been trying it and it seems that I can't and also I can't define the Type in the class as Public.
Thanks in advance,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
marcdev wrote: In VB6, is it possible to use a User Defined Type as the return parameter of a method class?
No. I know it sucks, but that's just the way it works. You should have it return a class object instead.
marcdev wrote: I can't define the Type in the class as Public
That's true too. Public Types are expected to be defined in Modules. Although, I do believe you can define private Types in a class.
|
|
|
|
|
... I'll have to reconsider it seriously and migrate to VB.Net ...
Thanks,
Marc.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Good afternoon,
What I did :
I browsed the directories für *.doc, *.pdf and *.txt files. The result I stored in
3 tables Table1, Table2 and Table3. With a query (DocResult), including this 3 tables, I got the result with 3 field ID, DocPath and Document.
Sample:
ID.....DocPath............................Document
125...C:\Document\Lesson.............DOTNET Tutorial.pdf
126...C:\Document\Lesson\Samples.DOTNET Samples.doc
........same directory.....................SQL samples.pdf
127...C:\Help\MIDI\Korg.................01WHowTo.txt
........same directory.....................KorkSamples.pdf
........same directory.....................Kork Basics.doc
and so on..
What I want:
I want to read each record and display the path and documents in a treeview like it is stored on my harddisk.
My code fragment :
dim ConString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\DocBase.mdb"
Dim rs As Object = CreateObject("ADODB.Recordset") 'Create recordset object.
Dim SQL As String = "...SQL String"
Dim Nd As New TreeNode()
Dim newNode As TreeNode
Nd = trv_TempMediaFiles.Nodes.Add("Root", VolumeName) 'Create Root node
rs.open(SQL, ConString, 3, 3) 'Open conection & execute SQL.
rs.movefirst() 'Move to first record.
For I = 0 To rs.recordCount - 1 'S1# loop through all records.
.....
.....
.....
rs.movenext() 'Move to next record.
Next I
rs.Close() 'Close recordset.
rs = Nothing 'Set to default value.
Since 2 weeks I tried to get the correct treenode structure but without success .
Is there anybody who can provide the missing code. My main problem is I am a newbie.
So I can discuss it only on a low level with you.
Thanks in advance Theo
|
|
|
|
|
|
Dear Joshua,
thank very much for your answer.
I read the sample code. But for my understanding it solves my problem only partly. To split the path in into folders I did already.
The problem I have is,
e.g when the last node LESSON in dir "C:\Document\Lesson" ist created and I want to create the next node SAMPLES in the directory "C:\Document\Lesson\Samples" i have to verify whether the path "C:\Document\Lesson" is already existing.
How can I do that ?
One method I heard about is to use a HASHTABLE. I tried this, but I could not understand the relation between HASHTABLE and Treenode. Beginner !
Regards Theo
|
|
|
|
|
You need to do a recursive search through the tree. There's no other way to search a tree with an unknown level of depth.
The TreeView.Nodes collection is your starting point; the root(s) of the tree. You can loop through this Nodes collection using a ForEach statement.
You can get a node's child nodes by calling TreeNode.Nodes. It's a collection too, which you can ForEach through. In fact, this is where recursion will come in happy. You should loop through the child nodes in the same code that loops through the parents.
|
|
|
|
|
I found the solution. This code suppose to work
VB.NET / Framework 2.0
This code is not my mental extract but it works. Only same little modifications I made
If the code doesn't work please let me know.
Public Class FillTreeView
Public Sub initilizeFillTreeView()
Dim i As Integer
Dim arrNames(8) As String
Dim node As TreeNode
arrNames(0) = "C:\Musik\Phil Collins\Live"
arrNames(1) = "C:\Musik\Phil Collins\Live\Lamp Lies down"
arrNames(2) = "C:\Dokumentation\Musik\Phil Collins"
arrNames(3) = "C:\Phil Collins\Dokumentation\Musik"
node = Form1.TreeView1.Nodes.Add(0, "Root")
For i = 0 To 3
addNode(node, arrNames(i))
Next
End Sub
Public Sub addNode(ByVal node As TreeNode, ByVal name As String)
Dim curNode As TreeNode
Dim subString() As String = name.Split("\")
Dim curName As String = subString(0)
Dim nextName As String = ""
Dim i As Integer
subString.Length > 1 Then
For i = 1 To subString.Length - 1
nextName &= subString(i) & "\"
Next
nextName = nextName.TrimEnd("\")
End If
Dim exsist As TreeNode = New TreeNode("")
For Each curNode In node.Nodes
If curNode.Text = curName Then
exsist = curNode
End If
Next
If exsist.Text <> "" Then
addNode(exsist, nextName)
Else
Dim newNode As TreeNode = New TreeNode(curName)
node.Nodes.Add(newNode)
If nextName <> Nothing Then
addNode(newNode, nextName)
End If
End If
End Sub
End Class
|
|
|
|
|
I have a script that is suppose to add Multiple computers in Active Directory by pointing to a .txt file. My script runs without any problems, but in never actually adds the computer objects. Any ideas or does anyone know of a better way of doing this?
addpcstoOU.vbs
' The script will take a text file with names and create computer accounts in your OU.
' To run the script open a command line and type cscript addpctoOU.vbs < workstations.txt
' where workstations.txt hold the names of the computer accounts you wish to add.
' This text file must contain one computer account name per line.
' In order to get the computer account in the correct OU you must edit the line
' Set objContainer = GetObject("LDAP://OU=workstations,OU=AIT,OU=ASET,OU=ITS,OU=UP,OU=PSUOUs," & _
' to reflect
' Set objContainer = GetObject("LDAP://OU=yourworkstationOU,OU=yourOU,OU=UP,OU=PSUOUs," & _
' To delegate the ability to add the machine to the network you must edit the line
' strComputerUser = "access\admin_mcc171"
' for questions send email to windiscuss@psu.edu
dim objFile, arrInfo, p
set objFile = WScript.StdIn
Do While Not objFile.AtEndofStream
call addpctoou(objFile.ReadLine())
Loop
set objFile=nothing
sub addpctoou(strComputer)
On Error Resume Next
' Edit this line to delegate the ability to install the machine into the OU
strComputerUser = "access\dlt_techs"
Const ADS_UF_PASSWD_NOTREQD = &h0020
Const ADS_UF_WORKSTATION_TRUST_ACCOUNT = &h1000
Const ADS_ACETYPE_ACCESS_ALLOWED = &h0
Const ADS_ACETYPE_ACCESS_ALLOWED_OBJECT = &h5
Const ADS_FLAG_OBJECT_TYPE_PRESENT = &h1
Const ADS_RIGHT_GENERIC_READ = &h80000000
Const ADS_RIGHT_DS_SELF = &h8
Const ADS_RIGHT_DS_WRITE_PROP = &h20
Const ADS_RIGHT_DS_CONTROL_ACCESS = &h100
Const ALLOWED_TO_AUTHENTICATE = _
"{68B1D179-0D15-4d4f-AB71-46152E79A7BC}"
Const RECEIVE_AS = "{AB721A56-1E2f-11D0-9819-00AA0040529B}"
Const SEND_AS = "{AB721A54-1E2f-11D0-9819-00AA0040529B}"
Const USER_CHANGE_PASSWORD = _
"{AB721A53-1E2f-11D0-9819-00AA0040529b}"
Const USER_FORCE_CHANGE_PASSWORD = _
"{00299570-246D-11D0-A768-00AA006E0529}"
Const USER_ACCOUNT_RESTRICTIONS = _
"{4C164200-20C0-11D0-A768-00AA006E0529}"
Const VALIDATED_DNS_HOST_NAME = _
"{72E39547-7B18-11D1-ADEF-00C04FD8D5CD}"
Const VALIDATED_SPN = "{F3A64788-5306-11D1-A9C5-0000F80367C1}"
Set objRootDSE = GetObject("LDAP://rootDSE")
' Edit this line to reflect your OU in the ACCESS Domain
Set objContainer = GetObject("LDAP://OU=Altoona,OU=Campuses,OU=DLT Public,DC=dlt,dc=access,dc=psu,dc=edu")
Set objComputer = objContainer.Create _
("Computer", "cn=" & strComputer)
objComputer.Put "sAMAccountName", strComputer & "$"
objComputer.Put "userAccountControl", _
ADS_UF_PASSWD_NOTREQD Or ADS_UF_WORKSTATION_TRUST_ACCOUNT
objComputer.SetInfo
Set objSecurityDescriptor = objComputer.Get("ntSecurityDescriptor")
Set objDACL = objSecurityDescriptor.DiscretionaryAcl
Set objACE1 = CreateObject("AccessControlEntry")
objACE1.Trustee = strComputerUser
objACE1.AccessMask = ADS_RIGHT_GENERIC_READ
objACE1.AceFlags = 0
objACE1.AceType = ADS_ACETYPE_ACCESS_ALLOWED
Set objACE2 = CreateObject("AccessControlEntry")
objACE2.Trustee = strComputerUser
objACE2.AccessMask = ADS_RIGHT_DS_CONTROL_ACCESS
objACE2.AceFlags = 0
objACE2.AceType = ADS_ACETYPE_ACCESS_ALLOWED_OBJECT
objACE2.Flags = ADS_FLAG_OBJECT_TYPE_PRESENT
objACE2.ObjectType = ALLOWED_TO_AUTHENTICATE
Set objACE3 = CreateObject("AccessControlEntry")
objACE3.Trustee = strComputerUser
objACE3.AccessMask = ADS_RIGHT_DS_CONTROL_ACCESS
objACE3.AceFlags = 0
objACE3.AceType = ADS_ACETYPE_ACCESS_ALLOWED_OBJECT
objACE3.Flags = ADS_FLAG_OBJECT_TYPE_PRESENT
objACE3.ObjectType = RECEIVE_AS
Set objACE4 = CreateObject("AccessControlEntry")
objACE4.Trustee = strComputerUser
objACE4.AccessMask = ADS_RIGHT_DS_CONTROL_ACCESS
objACE4.AceFlags = 0
objACE4.AceType = ADS_ACETYPE_ACCESS_ALLOWED_OBJECT
objACE4.Flags = ADS_FLAG_OBJECT_TYPE_PRESENT
objACE4.ObjectType = SEND_AS
Set objACE5 = CreateObject("AccessControlEntry")
objACE5.Trustee = strComputerUser
objACE5.AccessMask = ADS_RIGHT_DS_CONTROL_ACCESS
objACE5.AceFlags = 0
objACE5.AceType = ADS_ACETYPE_ACCESS_ALLOWED_OBJECT
objACE5.Flags = ADS_FLAG_OBJECT_TYPE_PRESENT
objACE5.ObjectType = USER_CHANGE_PASSWORD
Set objACE6 = CreateObject("AccessControlEntry")
objACE6.Trustee = strComputerUser
objACE6.AccessMask = ADS_RIGHT_DS_CONTROL_ACCESS
objACE6.AceFlags = 0
objACE6.AceType = ADS_ACETYPE_ACCESS_ALLOWED_OBJECT
objACE6.Flags = ADS_FLAG_OBJECT_TYPE_PRESENT
objACE6.ObjectType = USER_FORCE_CHANGE_PASSWORD
Set objACE7 = CreateObject("AccessControlEntry")
objACE7.Trustee = strComputerUser
objACE7.AccessMask = ADS_RIGHT_DS_WRITE_PROP
objACE7.AceFlags = 0
objACE7.AceType = ADS_ACETYPE_ACCESS_ALLOWED_OBJECT
objACE7.Flags = ADS_FLAG_OBJECT_TYPE_PRESENT
objACE7.ObjectType = USER_ACCOUNT_RESTRICTIONS
Set objACE8 = CreateObject("AccessControlEntry")
objACE8.Trustee = strComputerUser
objACE8.AccessMask = ADS_RIGHT_DS_SELF
objACE8.AceFlags = 0
objACE8.AceType = ADS_ACETYPE_ACCESS_ALLOWED_OBJECT
objACE8.Flags = ADS_FLAG_OBJECT_TYPE_PRESENT
objACE8.ObjectType = VALIDATED_DNS_HOST_NAME
Set objACE9 = CreateObject("AccessControlEntry")
objACE9.Trustee = strComputerUser
objACE9.AccessMask = ADS_RIGHT_DS_SELF
objACE9.AceFlags = 0
objACE9.AceType = ADS_ACETYPE_ACCESS_ALLOWED_OBJECT
objACE9.Flags = ADS_FLAG_OBJECT_TYPE_PRESENT
objACE9.ObjectType = VALIDATED_SPN
objDACL.AddAce objACE1
objDACL.AddAce objACE2
objDACL.AddAce objACE3
objDACL.AddAce objACE4
objDACL.AddAce objACE5
objDACL.AddAce objACE6
objDACL.AddAce objACE7
objDACL.AddAce objACE8
objDACL.AddAce objACE9
objSecurityDescriptor.DiscretionaryAcl = objDACL
objComputer.Put "ntSecurityDescriptor", objSecurityDescriptor
objComputer.SetInfo
end sub
|
|
|
|
|
I have vb scripts to install printers, printer drivers and printer ports and everything works great with that, but I haven't figured out any options to configure the printer after it is installed. Some of the options I'm referring to are installing a duplexing options, installing extra trays and finishers as needed, and configuring paper types. Any ideas?
|
|
|
|
|
hi there
i am trying to create a app so i can give a computerised quote.
i designed two windows forms that calculate the total etc.
however i got two options in my menu.
next quote, and recall quote.
the help i need is what code can i use or what do i do so that when i click the next quote number the quote number changes automatically and saves the previous quote automaically.and when i press recall quote it recalls a previous quote by number.any ideas>>>????please help
love to all.harm to none.
|
|
|
|
|
Howzit
I am looking for a way of deleting a selected range of page from a word document.
Any ideas or code snip bits would be appreciated.
Thanks in advance
R
Blou bulle is baas!
|
|
|
|
|
|
I am using the print preview control on a form and want to provide feedback on the mouse position in actual document relative position e.g. in the mouse move I have:
Private Sub PrintPreviewControl1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PrintPreviewControl1.MouseMove<br />
<br />
Me.Panel_CursorLocation.Text = PreviewControlPositionToDocumentPostion(New Point(e.X, e.Y)).ToString<br />
<br />
End Sub
and currently the function "PreviewControlPositionToDocumentPostion" does nothing e.g.:-
Private Function PreviewControlPositionToDocumentPostion(ByVal WindowPosition As Point) As Point<br />
<br />
Return WindowPosition<br />
<br />
End Function
How would I do the transform to x,y position on the document taking in to account the zoom factor or the preview control?
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Consider that we get the data in a dataset which is displayed to the user in the datagrid. When the user makes some changes or updates this data, I directly update the database and reload the data into the dataset and datagrid. Is it possible to update all the changes to the dataset and directly post the changes in the dataset to the database? If this is possible, does it take less time to process than the normal process of updating the database?
With Best Regards,
Mayur
|
|
|
|
|
Hii
You can use Update method of the DataAdapter and AcceptChanges method of DataSet to update the data source.
|
|
|
|
|
i have 2 tables A and B
is it possible in sql to get from B the last occurence (based on date) for each record in A?
ex
A
cust1
cust2
B
cust1 01012006 10.00
cust1 01022006 20.00
cust2 01022006 30.00
cust2 01032006 40.00
output
cust1 01022006 20.00
cust2 01032006 40.00
tnx in advance
maytel
|
|
|
|
|
Please check is it work or not:
Select custID, Max(date field) from B
group by custID
Where custID in (Select Distinct custID from A)
Mahbub8957
|
|
|
|
|
i forgot one detail
let me rephrase
is it possible in sql to get data from B (based on date SPECIFIED by the user) for each record in A?
date specified by user 01012006
A
cust1
cust2
B
cust1 01/01/2006 10.00
cust1 01/02/2006 20.00
cust2 12/31/2005 30.00
cust2 01/03/2006 40.00
output
cust1 01/01/2006 10.00
cust2 12/31/2005 30.00
|
|
|
|