Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all 21236 articles
Browse latest View live

Win7 Explorer Themed Selection pszClassList

$
0
0
Does MS provide pszClassList for Win7 File Explorer Theme Selection, so that I can fill OpenThemeData API to draw Hover and Selection Rectangle? Or just doesn't exist? If doesn't have, how to simulate? I want to draw such style for my ListBox.

Refer to my attached pic.

Edited: I open VBAccelerator's Theme explorer, it doesn't have "ListBox" theme.:( No wonder .NET ComboBox and ListBox also own plain focus rectangle.
Attached Images
 

Questions about using 'other tools' to replace Webbrowser Control.

$
0
0
*this is a newbie thread. Please do not use too much technical jargon*
*but practical and self-explanatory code samples offered will be most appreciated!!*
*as far as I know, there is vbRichClient by Olaf Schmidt so I tried*
*despite the void of detailed online documentation and a lot, a lot failed attempts to just make the program run*
*I waded my way to a bit progress. At the meantime, I also got many questions*

The following is my experiment with cWebkit with referrence to both vbRichClient5.dll and VB6-WebKit.tlb.

In the Module:

vb Code:
  1. Option Explicit
  2. Public Cairo As cCairo
  3. Public fMain As New cfMain
  4. Sub Main()
  5.   Set Cairo = New_c.Cairo
  6.   fMain.Form.Show
  7.   Cairo.WidgetForms.EnterMessageLoop
  8. End Sub

In the Class Module:

vb Code:
  1. Option Explicit
  2. Public WithEvents wk As cWebKit
  3. Public WithEvents wk2 As cWebKit
  4. Public WithEvents Form As cWidgetForm
  5. Public WithEvents Form2 As cWidgetForm
  6. Private mURL As String
  7. Private onceOnly As Boolean
  8.  
  9.  
  10. Private Sub Class_Initialize()
  11.     Set Form = Cairo.WidgetForms.Create(vbSizable, "My Main-Form Caption", True, 1365, 600, True)
  12.     Set Form2 = Cairo.WidgetForms.Create(vbSizable, "My Main-Form 2", True, 600, 600, True)
  13.     Form.Top = 0
  14.     Form2.Top = 0
  15. End Sub
  16.  
  17.  
  18. Private Sub Form_Load()
  19.     Set wk = New_c.WebKit(True, "C:\Program Files\Microsoft Visual Studio\VB98\MyResources\WebKitCairo")
  20.     wk.InitializeView Form.hWnd, 0, 0, Form.Width - 20, Form.Height - 35
  21.     wk.Navigate2 mURL
  22. End Sub
  23.  
  24.  
  25. Private Sub wk_NewWindowRequest(NewWebKitInstance As vbRichClient5.cWebKit, ByVal OpenAsTab As Boolean)
  26.     If OpenAsTab = True Then
  27.         Set wk2 = NewWebKitInstance
  28.         wk2.InitializeView Form2.hWnd, 0, 0, Form2.Width - 20, Form2.Height - 35
  29.         Form2.Show
  30.     End If
  31.     Debug.Print "NewWindowRequest " & OpenAsTab
  32. End Sub

The above code runs fine but I do not understand why if I put "cWebKit.Navigate2" before "cWebKit.InitializeView" nothing will show. And I also have questions why it's "navigate2" and not just "navigate". MS Webbrowser has navigate, navigate2, newWindow2, newWindow3 ... It's pretty much messed up and I still don't know the difference. Now again it comes "navigate2" and nothing else in a similar object.


vb Code:
  1. Private Sub wk_LoadCommited(URL As String)
  2.     Debug.Print "COMMITTED: " & " " & URL
  3. End Sub
  4. Private Sub wk_LoadFinished(ByVal BackCount As Long, ByVal ForwardCount As Long)
  5.     Debug.Print "FINISH: " & BackCount & " " & ForwardCount
  6.  
  7.     If Not onceOnly Then
  8.         onceOnly = True
  9.  
  10.         Dim mDocument As WebKit.IDOMDocument
  11.         Dim mHTML As WebKit.IDOMHTMLElement
  12.         Dim mTXTPath$, i&, n&
  13.         Set mDocument = wk.Document
  14.         Set mHTML = mDocument.documentElement
  15.        
  16.         mTXTPath = New_c.FSO.ShowSaveDialog(, App.Path, , "HTMLELEMENT", , "txt", Form.hWnd)
  17.         If mTXTPath <> "" Then
  18.             New_c.FSO.WriteTextContent mTXTPath, mHTML.innerHTML
  19.             New_c.FSO.ShellExecute mTXTPath
  20.         End If
  21.  
  22.         Dim mNodelist As WebKit.IDOMNodeList
  23.         Set mNodelist = mHTML.GetElementsByTagName("a")
  24.         n = mNodelist.length
  25.         On Error Resume Next
  26.         For i = 0 To n
  27.             Debug.Print mNodelist.Item(i).textContent
  28.             Debug.Print mNodelist.Item(i).nodeName
  29.         Next
  30.        
  31.     End If
  32. End Sub

1, I thought "WebKit.IDOMHTMLElement.dir" was going to give me a list of names but I got "object not supported error".

2, I don't understand difference between LoadCommitted and LoadFinish.

3, I tried to get href value of all anchor elements but can't figure it out. Along the way as shown in the above code, I also got several "automation error" and "object not supported" error in

vb Code:
  1. Debug.Print mNodelist.Item(i).textContent
  2. Debug.Print mNodelist.Item(i).nodeName

Luckily I was successful in getting the whole page HTML by "IDOMHTMLElement.innerHTML" but still wondering what are the better ways to do those stuff. To simply grab the HTML, I know there a whole lot other ways and tools to utilize such as Inet, xmlhttp ... But I'm looking for a tool of more newbie-friendly functionalites. Webbrowser is quite old and can't do well on many modern websites.

*I'm open to suggestions as to - if there is - a better one than vbRichClient.cWebkit*
*And quite willing to try out*



-----------------------------------------------------------
-----------------------------------------------------------


If Olaf comes in and see this thread, I also have some other questions - very basic - about other classes in vbRichClient:

What are the purposes of the following classes:

Quote:

cSimpleDOM
cWebRequest
cWebResponse
cWebServer
cView
cViews
Above classes are part of cWebKit or should be individually used for other tasks?

Quote:

cConnector
cConnection
cDatabase
cDBAccess
cDataObject
Meaning I can use them to get access to databases such as Access, mySQL, SQLite, etc.?

-----------------------------------------------------------
-----------------------------------------------------------

Finally, is it a good idea for a newbie to use vbRichClient as a default utility as opposed to other perhaps more Microsoft based utilities?

About cwTree control problem in vbWidgets.dll (based on vbRichClient5.dll)

$
0
0
'非常感谢奥拉夫.史密斯为我们提供的强大而优秀的vbRichClient5.dll
'现在的问题点:
'1.动态加载数据的问题:窗体首次启动时加载前3层数据(现在使用的代码直接加载了前3层数据),如何在单击每个节点时加载节点后面2层的数据.要求数据能高效率地加载树上.
'2.节点复选框的问题:如何修改代码,可以让树节点上的复选框可以被选中.
'3.单击时,如何能够获取节点的Key值;
'4.将索引/关键字/标题等内容,混合在Key值中,是否是一个好方法,有没有其它方法可以优化取代.
'5.如何在选中/取消树控件父节点复选框时,自动选中/取消该节点下面的子节点.
'6.如何在选中/取消树控件父节点时,自动选中/取消其上的所有父节点.
'7.希望能够后方法将cwTree封装得简单易用.如同Treeview一样的易用.
'请原谅我提出这么多的问题.


''thank God for Olaf. Smith provides us with powerful and good vbRichClient5.dll
''the question now point:
Dynamic loading
1. data problem: form when first start loading before the 3 layer data (now use the code directly loaded before the 3 layer data), how to load at each node when the node click behind the 2 layer data. Require data to be efficiently loaded on the tree.
'2. node check box problem: how to modify the code, check can make the tree node on the box can be selected.
3., how to obtain the node Key values;
4. will index / keywords / Title and other content, mixed in the Key value, whether it is a good method, there is no other method can optimize the substitution.
5. how to select / cancel the tree controls the parent node check box, a child node is automatically selected / cancel the node below.
6. how to select / cancel the tree controls the parent node, automatically select / cancel all parent nodes on it.
7. hopes to be able to post method cwTree package will be simple and easy to use. Like Treeview to use.

forgive me raise so many questions.
Attached Images
 
Attached Files

[RESOLVED] Separate string from between 2 delimiters in a string (Listbox)

$
0
0
Hi everyone,

I have few text documents with like 2,500 lines each,
which I need to remove just some portion from each line.
For this I always use the notepad (Replace) option, the problem
with this option is that I cannot use it with ever there are numbers,
In this case I just want to remove this part from each line of text: 26) = in the file.
But there are numbers on the way, and because of that I cannot accomplish this task.
For example:
Code:

25) = nuh
26) = kss
27) = CCC
28) = MRT
29) = Dism
30) = Teco
31) = ASO3
32) = aprp
33) = EPCP
34) = VCFw
35) = JGAA
36) = stij
37) = WSED
38) = sump
39) = Ares
40) = pwdg
41) = HpUI
42) = wmdc
43) = VOsrv
44) = hkcmd
45) = NASvc
46) = ofavu
47) = nmapp
48) = avgnt
49) = VCSpt
50) = SOHDs
51) = sssvc

The list goes on and one til 2,500.
I was wondering if I could create a tool to separate this from the rest of each line of text.
I was thinking of loading each text document into a lixtbox and then try to separate it there.
Any help or suggestion will be appreciate, thanks in advance.

[RESOLVED] Changing file (Open with) programmatically

$
0
0
Hi everyone,

I was wondering if there could be a way of changing the way a file is open with his default program,
or by assigning a program to be opening with that specific program programmatically using Visual Basic.
For example:
Name:  Open with.png
Views: 113
Size:  20.6 KB
In this example I have an .mp3 file which I was about to change the way I'll be opening with other media players:
QuickTime Player, iTunes, Windows Media Center, etc. I would like to find a code to make this change with VB6.
Any suggestion will be appreciate, thanks in advance.
Attached Images
 

[RESOLVED] how to check if a option box is chekced

$
0
0
i have 2 option boxes

1) OpWeek

2)OpCustom


there both values are false

is there a way to check that at least 1 of them needs to be checked before continuing?

tnx for any help
salsa31

How to detect a sentinel connect or disconnect from pc using VB6

$
0
0
Dear All,

Anyone know how to detect the USB dongle/sentinel connect and disconnect from pc and than get any dongle information like type, model, etc. I have already used USBDevicesView (nirsoft software) to check and get USB dongle information as below;

========================================================================
Device name USB UltraPro
Description SafeNet USB SuperPro/UltraPro
Device type Vendor Specific
Connected Yes
Safe to unplug Yes
Disabled No
USB Hub No
Drive Letter
Serial Number
Created Date 1/14/2015 10:19:04 PM
Last un/plug Date 1/15/2015 10:24:15 AM
Vendor ID 04b9
Product ID 0300
Firmware rev. 2.00
USB Class ff
USB SubClass 00
USB Protocol 00
HUB/Port
Computer Name
Vendor Name
Product Name
ParentId Prefix
Service Name SNTUSB64
Service descr. SafeNet USB SuperPro/UltraPro/HardwareKey
Driver Filename SNTUSB64.SYS
Device Class USB
Device Mfg SafeNet, Inc.
Power 26 mA
USB Version 1.00
Driver descr. SafeNet USB SuperPro/UltraPro
Driver version 7.5.8.0
Instance ID USB\VID_04B9&PID_0300\6&16fd800d&0&3
========================================================================

Beside that I was open the link in regedit and the link to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_04B9&PID_0300

Much appreciate for your helps. Thank you

Cheers,
Andre

[RESOLVED] variable not defined at Make time, but OK in IDE

$
0
0
My program runs just fine in the IDE, but when I try to make an exe, I get "Variable Not Defined" errors.
This is where the error first occurs, on fgmVidCap:

Code:

Public Function StartCamera(ByVal CameraName As String) As Boolean
    Dim AspectRatio As Double
    If Not fgmVidCap Is Nothing Then
        Error = 500
        Exit Function
    End If
    Set fgmVidCap = New QuartzTypeLib.FilgraphManager
    Error = BuildGraph(fgmVidCap, CameraName & FILTERLIST, CONNECTIONLIST) + 1
    If Error >= 1 Then
        Set fgmVidCap = Nothing
        Exit Function
    End If

I have a User Control, which includes:

Code:

     
Public fgmVidCap As QuartzTypeLib.FilgraphManager 
Public fiVidCap As QuartzTypeLib.IFilterInfo 
Public bv2VidCap As QuartzTypeLib.IBasicVideo2
Public vwVidCap As QuartzTypeLib.IVideoWindow

Both items start with Option Explicit.

I think this is possibly related to Early/Late Binding, but cannot figure out how to fix it!

Any help/suggestions will be welcome!

TIA.

Jim

need help with adding data to a table from a user form

$
0
0
hello i have toggle buttons from a-z each named: adda, addb, addc ect
i also have a text box named addtext

what i am hopeing to accomplish is to be able to toggle the button A (adda)
type into the text box named (addtext) foe example: Apple
when i click on the button called (addsave)

i want it to recognise that i have my A button toggled and save the text from the textbox and put it into a table named (tbla)
in a field named (Amplifier Name) on the left of my amplifier name field i have a field named numbers.

when i add to the amplifier name field i want the field to the left of this to auto populate the field on the left.

For example:
1 Apple1
2 Apple2
3 Apple3
Apple4

when i have added apple to the amplifier name field i want the field to the left of this called numbers to autopopulate a number.

any help would be greatly apreciated

Can I copy all properties from one control to another in s single statement?

$
0
0
Looking for something like:

command2 = command1

so that all relevant properties will be the same.

Is it possible?

Deleting files form Listbox

$
0
0
Hello. I am building a project for school. I take open source code from a youtube video and modify it for my needs but then a problem occurred. I want to delete the files that are in the Listbox. I had created a datebase from wich the files are compered. I'm a beginer don't juje me.
This is the code:
Imports System
Imports System.IO
Imports System.Text

Imports System.Security.Cryptography
Public Class Form1
Dim percent = 0
Dim red
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
percent = (ListBox2.Items.Count / ListBox1.Items.Count) * 100
If (ListBox1.SelectedIndex < ListBox1.Items.Count - 1) Then
ProgressBar1.Value = percent
Label2.Text = "Scanning For: " & ListBox1.SelectedItem
ListBox2.Items.Add("Scanning: " & ListBox1.SelectedItem)
Try
If Dir(ListBox1.SelectedItem.ToString) <> "" Then
ListBox3.Items.Add("Match Found: " & ListBox1.SelectedItem.ToString)
ElseIf Dir(ListBox1.SelectedItem.ToString, FileAttribute.Hidden) <> "" Then
ListBox3.Items.Add("Match Found: " & ListBox1.SelectedItem.ToString)
Else
End If
Catch ex As Exception

End Try
ListBox1.SelectedIndex += 1
Else
If ListBox3.Items.Count - 1 >= 1 Then
ListBox3.SelectedIndex = 0
Button3.Enabled = True
End If
Timer1.Stop()
ProgressBar1.Value = 100
Label2.Text = "Finished Scanning. " & ListBox3.Items.Count & "Mach(es) Found!"
Button2.Enabled = False
Button1.Enabled = True
End If
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button3.Enabled = False
Button1.Enabled = False
Button2.Enabled = False
ComboBox1.SelectedIndex = 0
ComboBox1.Items.AddRange(System.IO.Directory.GetLogicalDrives)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ProgressBar1.Value = 0
ListBox2.Items.Clear()
ListBox3.Items.Clear()
percent = 0
Button1.Enabled = False
ListBox1.SelectedIndex = 0
Timer1.Start()
Button2.Enabled = True
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedIndex >= 1 Then
ListBox1.Items.Clear()
TextBox1.Text = My.Resources.viruslist.ToString
For Each line As String In TextBox1.Lines
ListBox1.Items.Add(ComboBox1.SelectedItem.ToString & line.ToString)
Next
If ListBox1.Items.Count = 1 >= 0 Then
Label1.Text = "Database Loaded!"
Button1.Enabled = True
Else
Label1.Text = "No Database Loaded!"
Button1.Enabled = False
End If
Else
Button1.Enabled = False
ListBox1.Items.Clear()
TextBox1.Text = ""
Label1.Text = "No Database Loaded!"
End If
End Sub
Private Sub Label1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.TextChanged
If Label1.Text = "Database Loaded!" Then
Button1.Enabled = True
Else
Button1.Enabled = False
End If
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim li As Integer

Dim fn As Double


For li = ListBox3.SelectedIndices.Count - 1 To 0 Step -1

Next

fn = ListBox3.Items(ListBox3.SelectedIndices(li))

fn = String.Empty


If File.Exists(fn) Then

File.Delete(fn)

End If

ListBox3.Items.RemoveAt(ListBox3.SelectedIndices(li))

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Stop()
Button2.Enabled = False
Button1.Enabled = True
End Sub
End Class

[RESOLVED] Win7 Explorer Themed Selection pszClassList

$
0
0
Does MS provide pszClassList for Win7 File Explorer Theme Selection, so that I can fill OpenThemeData API to draw Hover and Selection Rectangle? Or just doesn't exist? If doesn't have, how to simulate? I want to draw such style for my ListBox.

Refer to my attached pic.

Edited: I open VBAccelerator's Theme explorer, it doesn't have "ListBox" theme.:( No wonder .NET ComboBox and ListBox also own plain focus rectangle.
Attached Images
 

Windows 10 Manifest file for VB6?

$
0
0
I've got a VB6 program that I distribute. I know nothing about Manifest files but I hear we will need one with Windows 10. My application doesn't require Admin and works well enough on Windows 7 and 8 without a Manifest file. Will I really need one?

The program comes with a pile of .DLL and .OCX files for things like scanners and word processing. Do I need to list every DLL and OCX inside the manifest? Anybody have a decent sample for a VB6 program?

Many thanks in advance for your help.

Finding text files on a directory.

$
0
0
I have a loading program which I wrote a few years ago, and I'd like to make some changes to it.

It's only function is to load text files from a network drive into our Oracle database. It works fine, but here's how it currently works.

Open the app-->click "Select file"-->select the text file from the dialogue box-->select "Run"--> file loads and is moved to another directory.

The text files in the directory are generated one per day. Sometimes when I go to load the data there are a few days worth of files in there, and sometimes it's just one file I need to load.

What I'd like to do is modify the program so that upon opening it just searches the directory for text files and loads them automatically.

Since the program is already written as stated above, I just need to know how to scan a directory for text files. I can make it work from there.

I've read about the DIR function as well as some other methods, but I'm not sure I get them. Any tips or nudges in the right direction would be appreciated.

Making my codwe shorter and Easier to read and Write

$
0
0
Hey guys I have this piece of code for running a Stored Procedure, and I was wondering if there is a way of cutting code like:

Code:

  uPar = .CreateParameter("@PropertyID", ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamInput)
        .Parameters.Append(uPar)
        .Parameters("@PropertyID").Value = Val(lblPropertyIDValue.Text)

As I have a lot of stored procedures in my system this takes a lot of time, my boss seems to think there could be a way to possible cut this down to one line of code and make it a lot easier to read and write, though I'm not sure what way to go about this.

Hope someone can help.

Thanks

Code:

Public Function SaveProperty() As Boolean
    '** Save Current Personal Data Record

    ' Error Checking
    On Error GoTo Err_SaveProperty

    ' Dimension Local Variables
    Dim uRecSnap As ADODB.Recordset
    Dim uPar As ADODB.Parameter

    ' Check For Open Connection
    If uDBase Is Nothing Then
        OpenConnection()
        bConnection = True
    End If

    ' Run Stored Procedure - Save Property Record
    uCommand = New ADODB.Command
    With uCommand
        .ActiveConnection = uDBase
        .CommandType = ADODB.CommandTypeEnum.adCmdStoredProc
        .CommandTimeout = 0
        uPar = .CreateParameter("@PropertyID", ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamInput)
        .Parameters.Append(uPar)
        .Parameters("@PropertyID").Value = Val(lblPropertyIDValue.Text)
        uPar = .CreateParameter("@PropertyManager", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 60)
        .Parameters.Append(uPar)
        .Parameters("@PropertyManager").Value = cmbPropertyManager.Text
        uPar = .CreateParameter("@AddressLine1", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 30)
        .Parameters.Append(uPar)
        .Parameters("@AddressLine1").Value = txtAddress1.Text
        uPar = .CreateParameter("@AddressLine2", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 30)
        .Parameters.Append(uPar)
        .Parameters("@AddressLine2").Value = txtAddress2.Text
        uPar = .CreateParameter("@AddressLine3", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 20)
        .Parameters.Append(uPar)
        .Parameters("@AddressLine3").Value = txtAddress2.Text
        uPar = .CreateParameter("@Town", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 30)
        .Parameters.Append(uPar)
        .Parameters("@Town").Value = txtTown.Text
        uPar = .CreateParameter("@PostCode", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 30)
        .Parameters.Append(uPar)
        .Parameters("@PostCode").Value = txtPostCode.Text
        uPar = .CreateParameter("@Availabilty", ADODB.DataTypeEnum.adDate, ADODB.ParameterDirectionEnum.adParamInput)
        .Parameters.Append(uPar)
        .Parameters("@Availabilty").Value = chkAvailable.Checked
        uPar = .CreateParameter("@Available", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 30)
        .Parameters.Append(uPar)
        .Parameters("@Available").Value = dtpAvailable.Text
        uPar = .CreateParameter("@Factored", ADODB.DataTypeEnum.adTinyInt, ADODB.ParameterDirectionEnum.adParamInput)
        .Parameters.Append(uPar)
        .Parameters("@Factored").Value = -chkFactored.Checked
        uPar = .CreateParameter("@FactorsName", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 20)
        .Parameters.Append(uPar)
        .Parameters("@FactorsName").Value = txtFactorName.Text
        uPar = .CreateParameter("@FactorsEmail", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 30)
        .Parameters.Append(uPar)
        .Parameters("@FactorsEmail").Value = txtFactorsEmail.Text
        uPar = .CreateParameter("@PropertyBuilt", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 30)
        .Parameters.Append(uPar)
        .Parameters("@PropertyBuilt").Value = dtpPropertyBuilt.Text
        uPar = .CreateParameter("@PropertyValue", ADODB.DataTypeEnum.adDate, ADODB.ParameterDirectionEnum.adParamInput)
        .Parameters.Append(uPar)
        .Parameters("@PropertyValue").Value = txtPropertyValue.Text
        uPar = .CreateParameter("@MimimumFee", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 30)
        .Parameters.Append(uPar)
        .Parameters("@MimimumFee").Value = txtMinimumFee.Text
        uPar = .CreateParameter("@Commission", ADODB.DataTypeEnum.adTinyInt, ADODB.ParameterDirectionEnum.adParamInput)
        .Parameters.Append(uPar)
        .Parameters("@Commission").Value = -txtCommision.Text
        uPar = .CreateParameter("@CostSuthorisationAmount", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 20)
        .Parameters.Append(uPar)
        .Parameters("@CostSuthorisationAmount").Value = txtCostAuthorisationAmount.Text
        uPar = .CreateParameter("@Vacant", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 30)
        .Parameters.Append(uPar)
        .Parameters("@Vacant").Value = chkVacant.Checked
        uPar = .CreateParameter("@VacantDate", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamInput, 30)
        .Parameters.Append(uPar)
        .Parameters("@VacantDate").Value = dtpVacant.Text
        uPar = .CreateParameter("@StartingRent", ADODB.DataTypeEnum.adDate, ADODB.ParameterDirectionEnum.adParamInput)
        .Parameters.Append(uPar)
        .Parameters("@StartingRent").Value = txtStartingRent.Text

        .CommandText = "PropertyMaster_SaveRecord"

        .Execute()
    End With

    ' Close Connection
    uRecSnap = Nothing
    uCommand = Nothing
    If bConnection Then CloseConnection()
    SaveProperty = True

 Err_SaveProperty:
    If Err.Number <> 0 Then
        sErrDescription = Err.Description
        WriteAuditLogRecord("clsProperty", "SaveProperty", "Error", sErrDescription)
        SaveProperty = False
    End If

End Function


Error no: 484 Problem getting printer information from the system. in VB 6 app

$
0
0
I have a VB 6 app which is a server product. If a user working on a workstation sends a request from their workstation to the server to print to a specific printer, my VB app throw up the error:
Error no: 484 Problem getting printer information from the system. Make sure the printer is set up correctly and the printed output does not occur.

However, if the app is run on a desktop or directly on the server, then NO error occurs despite calling the same printer.

Can anyone help me to trouble shoot this problem. Just bear in min that the workstation is connected to the server where my app is installed and only when the request comes from a User via their workstation. The printer has been assigned User permissions and the same use can print to the same printer if my app is installed on a desktop strange?


Thanks for any help
Regards
Mark
:ehh:

VB 6.0 for equipment automation

$
0
0
Hi everyone,

I have been given a new project at work. I have to automate some equipment. Currently, I am learning to automate a parameter analyzer, the Agilent B1505A. I have found some examples in manuals on how to use VB 6.0 to program the analyzer. However, I am really new to this, and I have only ever used VBA for excel macros.

In the programming basics of the manual, it lists the steps below which I have a few questions about:

1) Connect instrument to computer via GPIB (DONE)
2) Launch Visual Basic and create a new project. (I downloaded the Express 2013 for Windows Desktop and open a new console application, is that the correct one to download open?)
3) Import the following file to the project: agb1500.bas and visa32.bas

I was able to find the visa32.bas file. If I can't find the other, is it possible to find missing .bas files somewhere else online? How do I import them?

4) Open a form. (What is a form? Is this where the main subroutine should be written)

Thanks again

How to get pixel and import it to table

$
0
0
i've been looking for code that can get me value pixel from image, but i just got code that display the value of pixel and just one pixel from whole image. what i want is all of value pixel from image that has been imported to table form or to excel, like this Name:  example.jpg
Views: 89
Size:  25.9 KB
is there anyone that can help me, please?
anything
thx
Attached Images
 

How to make a simple matrix function to do two basic operation rows ?

$
0
0
Hi community!!
How to make a simple matrix function to do two basic operation rows ?
my basic operations used on the rows of a matrix are:
a)Adding two rows within a matrix together
b)Multiplying a row with a number
Sub OPERATIONROWS(): On Error Resume Next
Dim Rows As Range, n As Range, Offsetm As Integer, Offseta As Integer

Set Rows = Application.InputBox("Selecct row ranges (n, m y a) to perform operation row " & Chr(10) & _
"NOTE: hold Ctrl while you select cells and use right clic to select cells", Type:=8)

If Rows Is Nothing = True Then Exit Sub


If Rows.Areas.Count <> 3 Then
MsgBox "you must select 3 ranges"
Exit Sub
End If


If Not (Rows.Areas(1).Rows.Count = 1 And _
Rows.Areas(2).Rows.Count = 1 And _
Rows.Areas(3).Rows.Count = 1) Then
MsgBox "range can only have one row"
Exit Sub
End If


If Not (Rows.Areas(1).Cells.Count = Rows.Areas(2).Cells.Count And _
Rows.Areas(2).Cells.Count = Rows.Areas(3).Cells.Count) Then
MsgBox "range must have same numbe rof cells"
Exit Sub
End If


Offsetm = Rows.Areas(2).Row - Rows.Areas(1).Row
Offseta = Rows.Areas(3).Row - Rows.Areas(1).Row
For Each n In Rows.Areas(1)
ActiveCell = n + n.Offset(Offsetm) * n.Offset(Offseta)
Name:  visual_basic_funcion_sencilla.jpg
Views: 45
Size:  80.0 KB
Bye
Attached Images
 

Advanced Shell In Visual Basic

$
0
0
Hello everyone,

I am trying to access a second option on the "advanced sharing settings" in control panel.
Code:

This is my code: "Shell:::{8E908FC9-BECC-40f6-915B-F4CA0E70D03D}, vbNormalFocus"
which allow me to open "advanced sharing settings" but how could I make it go to the advance option?
I mean, back in Windows XP when I used to open or run all control panel applet I used to add 1,2,3, etc.
to go to a diferent parts or zone's on any particular option opened from visual basic.
With some other options on control panel what worked for me is adding "\settings" at the end of the GUID,
but in the case with this option thats not an alternative option to go to that part of the advancee settings.
Any idea, suggestion, help will be appreciate, thanks in advance.
Viewing all 21236 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>