This article describes how to create a database in a program without using Access, and then read data from standard ASCII text files to the database. The original article is an article in the Microsoft Knowledge Base, but it was written for VB3 at the time, so the code here is a bit outdated. For example, if no Table object exists in DAO, replace it with a Recordset object. The following is the modified code, which is successfully debugged in VB6.
Add
Environment: Windows Server 2003
In the language and region settings, the region has been set to the United States, and the date format is "mm/DD/YYYY". However, in the Active x dll of VB6, the format $ (now, "Short date") the date format is always "DD/MM/YYYY", which cannot be understood. Using ASP, a simple EXE is made with VB6.Program, The displayed formatted date format is correct, that is, the DLL doe
The program compiled with VB6 10 years ago will be continuously used for repair, modification, and modification, and will continue to be used for several years.
I recently took over this program, except for the "sad reminder", I really cannot come up with other words to describe my mood.
A little nonsense. Recently, it took some time to call the stored procedure and finally solved the problem. I posted the result. If someone else is using
This article describes how you can create a database directly in your program without using access, and then read the data from a standard ASCII text file into the database. The original is a Microsoft Knowledge Base article, but was written for VB3, so the code is a bit outdated. For example, there is no Table object in the DAO now, instead of a Recordset object. The following is the modified code, which is debugged in VB6.
First, add the Microsoftd
Comparison | key word | function VB. NET vs. VB6: deactivated keywords and functions
The development of history is a process of continuous sublation, VB. NET is the same. It does not hesitate to delete a number of keywords and functions, many of which are many VB6 programmers will never miss. For example, a Deftype statement that has been deleted. This statement is a throwback to FORTRAN, allowing develope
This article describes in detail how VB6 writes the application icon in the Tray
Related articles:
Realization of tray animation icon with VB
VB Tray Program detailed a
VB Tray Program detailed two
VB Tray Program detailed three
VB Tray Program detailed four
VB Tray Program detailed five
Also talk about automatic disk saving under Windows
Using WINDOWSAPI to get advanced features of the system
1, the new establishment of a
Call WebService in VB6 or ASP
WEB Services technology enables heterogeneous computing environments to share data and communication to achieve information consistency. We can use
HTTP Post/get Protocol, SOAP protocol to invoke Web Services.
First, using the SOAP protocol to invoke web Services in VB6
; First use. NET to publish a simple web Services
Public Function getString (ByVal str As String) as St
VB6 Code:Private Declare Function isuseranadmin Lib "Shell32" Alias "#680" () as Integerprivate Sub Form_Load () If isuseranadmin () = 0 Thenmsgbox "not admin" elsemsgbox "admin" End IfEnd Sub Get Windows OS version information:Option explicitprivate Declare Function getversionex Lib "kernel32" Alias "GetVersionExA" _ (Lpversioninformation as OS Versioninfo) as Longprivate Type osversioninfo osvsize as Long dwvermajor as long dwverminor as long dwBu
In VB6, we use on error to capture and handle errors, and often use on error resume next to generate possible ignore errors.
Will error capture affect the speed?
Yes, using error handling will reduce some performance. . Net, using try catch will also affect the performance, so we use
When reflector decompile Microsoft's class library, it will find that its sub-processes seldom use try to capture errors. Generally, they use predictable methods to deter
CCW (COM callable wrapper) is a mechanism provided by vs2005. It can export. Net hosted DLL to a traditional com to facilitate VB6 and ASP calls. Below is a common example:
1> Create a General C # class library project in vs2005 and write the code
//// Assume that the space is named cslib2 and the class name is class1 // the blue part is very important. // using system;
Using system. Collections. Generic;
Using system. text;
Using system. runtime. i
VB6 or ASP format time for mm/dd/yyyy format, there is no good way,Format or formatdatetime The result is related to the date and time format of the locale language of the system setting. This means that even though you are using a date and time format delimiter such as format (now, "mm/dd/yyyy") if the system formats the locale language, then he will also show up as mm-dd-yyyyOnly pieced together:Response.Write TestdateformatFunction Testdateformat (
Error | Error handling | speed
In VB6, we use on error to catch and handle errors, and we often use on error Resume Next to ignore errors that may arise.
So does using error trapping affect speed?
Yes, using error handling will degrade some of the performance in. Net, using Try Catch will also affect performance, so we use
When Reflector decompile Microsoft's class library, it finds that his child processes rarely use Try to catch errors, basically by
Image capture in VB6 and vb.net
Image capture in VB6
'----------------------------------------------------------------------------
'
' Author:lihonggen0
' Date:2002-6-19
' Function: Grab screen
'----------------------------------------------------------------------------
Private Type Pointapi
X as Long
Y as Long
End Type
Private Declare Function BitBlt Lib "gdi32" (ByVal hdestdc as Long, ByVal x as Long, B
Set wallpaper in VB6
Private declare function systemparametersinfo lib "USER32" alias "systemparametersinfoa" (byval uaction as long, byval uparam as long, byval lpvparam as any, byval fuwinini as long) as long
Set wallpaper in VB. NET 2003
Private const spi_set1_wallpaper as integer = H14
Set the wallpaper in VB. NET 2005:
Private const spi_set1_wallpaper as integer = H14
Refer:
Systemparametersinfo Function Definition and parameters:
The statem
For Google and csdn, there is no correct and rigorous VB6 to determine whether the string contains Chinese characters, or simply to determine whether the ASC () return value is less than 0 (this can only determine whether it is a double byte string, such as Korean, Japanese, Chinese, and Arabic. It cannot be determined as Chinese. It is not rigorous to judge Chinese characters.It is better to give a more rigorous method to determine whether or not it
Today, my brother found an interesting phenomenon when debugging the program. The system prompts "circular relationship between modules". Let's look at the sample code below:
'CD
Option explicit
Public event clickevent ()
Public withevents C as CE
Public sub click ()
Raiseevent clickevent
End sub
Private sub c_clickevent ()
'
End sub
'Ce
Option explicit
Public event clickevent ()
Public withevents C as CD
Public sub click ()
Raiseevent clickevent
End sub
Private sub c_clickevent ()
'
En
The time in the program is usually-1-1 to the current time.
Function getsecondsfrom1970 () as long '% s seconds since' 00: 00: 00 1970-01-01 UTC "(a GNU extension) getsecondsfrom1970 = datediff (" S "," 1970/01/01 ", now () '2014/02 18:11:24 => 2011/03 end functionfunction getdatetimefromseconds (byval seconds as long) as string getdatetimefromseconds = format (dateadd ("S", seconds, "1970/01/01 "), "yyyy/mm/dd hh: mm: SS") '2017 => 1299089484 06:11:24 end Function
The XML schema language is the standard for verifying the XML document format. You can use XML schema in VB6 to verify the validity of XML.
This example demonstrates how to use Microsoft XML Parser 4.0 to verify XML files. First, create a file named wellformed. XSD and add the following code to it:
Xmlns = "http://tempuri.org/WellFormed.xsd"Xmlns: xs = "http://www.w3.org/2001/XMLSchema"Attributeformdefault = "qualified"Elementformdefault = "qualified"
= 1Imgscan1.pagetype = 1Imgscan1.compressiontype = 4Imgscan1.compressioninfo = 1Imgscan1.scanto = 2' save as a fileImgscan1.image = theimagefile the image will be savedImgscan1.showsetupbeforescan = trueImgscan1.multipage = trueReturnvalue = imgscan1.startscan ()DoeventsImgscan1.closescanTeststring = Dir (theimagefile)If teststring Scantheimage = trueEnd ifElseMsgbox "scanning devices are not available"Exit FunctionEnd ifEnd Function
Iii. Examples of joint applications
This document adds an exa
You need to use VB6 to read network card network management information and set it. So I found a piece of code that uses WMI's system query method to loop through all network adapters and obtain information.
Of course, you can add judgment and processing.
Option explicitDim objswbemservices as swbemservicesDim objswbemobjectset as swbemobjectsetDim objswbemobject as swbemobjectPrivate type netcardName as stringIpadress as stringIpsubnets as stringIpg
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.