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

Add ( WHERE + word ) at query

$
0
0
Hello VBForums
Hello every one
Please Gentelman if you can help me to resolve this problem
In my Table1 i have two fields ( Id - Factory )
In the factory field I have several records ( Pen - Book - Notebook )
How to add ( Where Book ) to this query :
Code:

RS.Open "Select Count([Factory]) as RowsTotal From Table1 Where [Factory]<>''", DB, adOpenStatic, adLockPessimistic
Thank you in advance for help
Cordially
MADA

How to run vb6 apps on wine(Linux)?

$
0
0
I want to test vb6 apps(such as jpbro's vbFcgi example) on wine. I've installed wine on Linux, but I don't know how to run my vb6 apps on wine. I wonder where there is such an example. Thanks!

Qos2 api

$
0
0
Hi Guys,

Does anyone have any code examples of using this? Specifically I need to be able to use QOSSetOutgoingDSCPValue to set the DSCP TOS bit mask for ICMP and UDP. This used to be super easy prior to Vista and now it seems like a mission.

thanks

CoGetObject API -- Initialize and get a pointer to the Office IRibbonUI Interface ?

$
0
0
Hi all,

I am trying to get a pointer to the OFFICE IRibbonUI Interface using the CoGetObject API in the code below but the last OUT argument (ByRef ppv As Any) of the CoGetObject function returns an UnKnown type or an Object type instead of IRibbonUI type .

Can anyone shed a light on this ?

Thank you.

Code:

Option Explicit

Private Type GUID
    data1    As Long
    data2    As Integer
    data3    As Integer
    data4(7) As Byte
End Type
 
Private Declare Function IIDFromString Lib "Ole32" ( _
ByVal lpszIID As Long, _
iid As Any) As Long

Private Declare _
Function CoGetObject Lib "Ole32" ( _
        ByVal pszName As Long, _
        ByVal pBindOptions As Long, _
        ByRef riid As GUID, _
        ByRef ppv As Any) As Long
 

Sub Test()

    Dim iRibbon As IUnknown  ' As Object
    Dim iid    As GUID
    Dim hRes As Long
   
    Const IID_UNKNOWN As String = "{00000000-0000-0000-C000-000000000046}" 'Iunknown Interface GUID.
   
    'get the iunknown interface
    hRes = IIDFromString(StrPtr(IID_UNKNOWN), iid)
   
    'get pointer to the iRibbonUI interface
    '"{926749fa-2615-4987-8845-c33e65f2b957}" = UIRibbonFramework ClassID

    hRes = CoGetObject(StrPtr("new:926749fa-2615-4987-8845-c33e65f2b957"), 0, iid, iRibbon)
   
    MsgBox TypeName(iRibbon) '<=== Should return IRibbonUI but returns UnKnown

End Sub

[RESOLVED] trying to check between hours nothing works why?

$
0
0
hey,
i have a waiting list that i add customers there.
now, in there i add the customer name and the hours that he is free to schedule an appointment.
when there is a free appointment in my schedule i need to check if there is a customer
that is waiting between the hours he is free.
E.X
salsa can make to the appointment from 11:00 to 12:00

so if i cancel an appointment in my schedule (that the appointment was in 11:15)
then i need to check the waiting list to see if there is any customers that is free between these hours.

i tried to use some code but it dosnt work at all.
this is the code i am using
Code:

If Format(Rs!WaitFromHour, "HH:MM:SS") >= StrTimeStartEvent Or Format(Rs!WaitUntilHour, "HH:MM:SS") <= StrTimeEndEvent Then...'
tnx for any help
salsa :)

[RESOLVED] Can GDIplus save grayscale JPEG &/or TIFF as 8-BPP grayscale JPEG/TIFF?

$
0
0
Using the newer version of GDIplus on Win 7/Win 10, is there a way to save a grayscale JPEG/TIFF to an 8-BPP grayscale JPEG/TIFF?
There is no problem saving a grayscale JPEG/TIFF in grayscale image, but to be recognized as 8-BPP (by softwares), it must meet the respective criteria:

For JPG, "No. of components" in SOF0 (Baseline DCT) is 1, not 3.
For TIFF, "PhotoMetricInterpretation" (tag 262) is 0/1, not 3.

Any one knows the method or trick?

Using ReactOS and Vb6 for embeded device

$
0
0
Hello Group,

Was wondering if anyone out there has used reactOS for an embeded solution to run vb6 app. Is it realiable enough (reactOS and vb6 created app) to publicly distribute.

They have been in BETA for-ever, just wondering if anyone here has used this combo for an embedded solution?

Thanks

How to enum all running DDE servers in a system?

$
0
0
Hello,

I want to enum all running DDE servers in a system if MS Excel is running I want to connect with it.

I know how to connect with Excel using DDE but how to enum all running DDE servers in a system?

Regards,

Email selecting list

$
0
0
I want select several email address from a list like in attach image. I got it from internet search, but not in vb. Can do it?

[RESOLVED] how can i get the total time between the time?

$
0
0
hey,
is there a way to get the total time between 2 diffrent hours?
e.x

Code:

18/07/2018 11:00:00 - 18/7/2018 11:15:00 total time = 15 minutes
18/07/2018 13:00:00 - 18/7/2018 13:45:00 total time = 45 minutes

total time  in 18/07/2018 = 60 minutes

and so on...
tnx for any help
salsa:)

Deleting null rows in a table

$
0
0
I added a new row to a table and then i opted not to enter details but rather remove the new row.Each time i try deleting the null row i get a run-time error "empty row cannot be inserted", how can i remove this row from the table?

Saving a XLSX WorkBook in Visual Basic 6.00

$
0
0
Hello guys, it's me again.

I wish to know how to save a Worksheet which is called the filename, using Text1.Text contents, then add a XLSX as the file extension. then to add things like the contents of the Form called Reg.frm, to then be written to a different Row of a single Column. then to also check before hand if the username, which is in A1 in the Worksheet then to check it with the contents of txtUsername.Text. Then there is a graphic photo that is to then be saved, in the Column called Photo and the picture box in Reg.frm called Photo.Picture…

!! Thanks in advance !!

Using multiple printers

$
0
0
Once again, more tinkering with our good old VB6 EPOS system. We use two printers on each workstation, a slip printer for receipts and an A4 printer for everything else.

At present, there is nothing in the program to know which printer to use, everything just prints to the default printer and the user manually changes the default in Control Panel to get the output of the correct printer. This was never ideal, but was a simple process to train the users on in Windows 7 where switching printers is very easy.

We are looking at migrating to Windows 10 where the default printer settings are a bit more hidden and so I'd like to take the opportunity to develop the program to know what is supposed to print where and end users having to manually switch.

I do remember writing an Excel macro years ago which could switch printers, but this relied on knowing the name of the printer in Windows. Ensuring that every workstation has the printers named exactly the same would be too easy to break and I can already see it taking up a lot of support time.

I was hoping to do something a bit more abstract where I could add definitions for the slip and A4 printers which can be set within the program. The idea would be to add a UI control for 'slip printer' which would launch the common print dialogue, then the required printer would be selected and the program would store this setting as the slip printer. After that all receipts would simply be sent to the 'slip printer' and the program would look up what printer it has set for that. There would then be another setting implemented on the same lines for the A4 printer.

This would make it easy to deal with the printers being named differently across different machines.

Any ideas on how to start with this (or if it's even possible?)

[RESOLVED] trying to convert minutes to hours disnt calculate right why?

$
0
0
hey,
i have some minutes that i want to calculate to hours
but it shows me the wrong calculation why?

salsa 45 minutes
danny 45 minutes
total in hours 1.30 Hours
but in my code it shows me 1.50
Code:

FormatNumber(TotalHours / 60, 2, vbTrue)
tnx for any help
salsa :)

Extract VBA code from another workbook

$
0
0
Hey Guys,

I am looking to extract a certain line of code from another workbook and display the code line as text in another workbook. I know you can extract certain cell data from another workbook, but can you extract actual vba code from another workbook and have it display as text?

I would like my program to search for and pull a certain line of code from another workbook (any workbook that is) and make it visible to the user by displaying the code in a cell.

Thanks!

[B]Why can my Winsock class not accept incoming sockets??[/B]

$
0
0
I have a small project where I want/need a Windows Service (no forms) to create a web server.
So now my project is a service just fine, but when I use an Asynch class to try to create a Winsock TCP/IP server, it works and I can get connections, but when I try loading another socket I cannot accept the socket?
Any idea why? My project is attached here.
VB6 Winsock Server Service.zip
Attached Files

Date difference in weeks and days?

$
0
0
Hello Vbforums community.
I need an expert in date functions to help me calculate the the number of weeks and days from a datepicker.
If I input this date 23/06/2018 in the datepicker, I should get 4 weeks and and 2 days.
Thank you in advance

[RESOLVED] [B]Why can my Winsock class not accept incoming sockets??[/B]

$
0
0
I have a small project where I want/need a Windows Service (no forms) to create a web server.
So now my project is a service just fine, but when I use an Asynch class to try to create a Winsock TCP/IP server, it works and I can get connections, but when I try loading another socket I cannot accept the socket?
Any idea why? My project is attached here.
VB6 Winsock Server Service.zip
Attached Files

[RESOLVED] Error 20515 A date is required here.

$
0
0
Name:  untitled.JPG
Views: 89
Size:  18.6 KB

I'm getting this error when generating report.

The error falls in this line.

Code:

            .SelectionFormula = "{View_MasterInfo.EmployeeType} <> 'RANK & FILE' and {View_MasterInfo.DateHired} <= '" & DTPicker1.Value & "'"
What do you think I'm missing?
Attached Images
 

Class Terminates before the reference to the instance goes out of scope?????

$
0
0
Hello.

I have a class (Class2) that is intantiated from the code of another class (Class1), and this other class (Class1) holds a reference to the first (Class2).

The normal behavior is that the class inside the other (Class2) will terminate at the end or after the class holding a reference to it (Class1) terminates.

I attached a sample code that shows that normal behavior.

But... I have a problem in a real program where Class2 terminates before Class1, even when Class1 has a variable referencing it.

And since I have code in the Class_Terminate event of Class1 that access a member of the Class2 instance (that is terminated), it produces a crash...

If I put at the Terminate event of the holding classw (Class1) a line with a Debug.Print telling the ObjPtr of the Class2 instance, it returns the correct object instance pointer (the same number checked after the class was created), but the class already fired its terminate event and just trying to use a variable accessed from one of its properties causes the crash.

Anyone have any idea what could be going on there?

I think I'll have to reinstall VB6, to start trying something... That's too strange.
It seems like the objec t reference counter is confused.
Attached Files
Viewing all 21399 articles
Browse latest View live


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