vb6

Connecting VB6 and MS Access 2007

▼魔方 西西 提交于 2020-01-03 02:08:55
问题 I'm trying to create a simple visual basic 6 program/database that uses ms access 2007 as the back end. I have no background with vb programming. I just want to as what are the simplest way(s) in connecting vb and access? I've searched almost all over the internet on how to do this but I think I'm doing it wrong. Can anybody help me? Thanks. 回答1: Use ADO. Theres a tutorial in the VB6 user guide about connecting VB6 to Access. http://msdn.microsoft.com/en-us/library/aa240855(v=vs.60).aspx You

How can I read HDD volume serial number using VB 6?

蓝咒 提交于 2020-01-02 18:36:48
问题 How can I read HDD volume serial number using VB 6 but without using any ActiveX controls or third party add-ons? 回答1: Private Declare Function GetVolumeInformation _ Lib "kernel32" Alias "GetVolumeInformationA" _ (ByVal lpRootPathName As String, _ ByVal pVolumeNameBuffer As String, _ ByVal nVolumeNameSize As Long, _ lpVolumeSerialNumber As Long, _ lpMaximumComponentLength As Long, _ lpFileSystemFlags As Long, _ ByVal lpFileSystemNameBuffer As String, _ ByVal nFileSystemNameSize As Long) As

Using Alias keyword to declare a function in VBA

假装没事ソ 提交于 2020-01-02 15:57:54
问题 I have VBA MS Access form code, where I type the following function declaration: Public Declare Function GetUserName Lib "advapi32.dll" () Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long However I'm getting an error on Alias . Do I have to add some references in order to use this? 回答1: No, there are no special libraries are required to use Alias ; this is all built into the language. But your declaration is wrong. You have an extra set of parentheses placed just before

Convert VB6 Scripting.Dictionary to .NET Generic Dictionary

喜欢而已 提交于 2020-01-02 13:58:31
问题 Currently im working on wrapping and converting some old VB6 code to .NET and i need to be able to use the scripting.dictionary returned by huge old price of VB6 code. I want to convert this to the .NET generic Dictionary(Of TKey, TValue) 回答1: The solution is to write an extension method for scripting.dictionary to convert to a .net Dictionary(Of TKey, TValue) VB.NET <Extension()> Public Function ToDictionary(Of T, T2)(dic As Scripting.Dictionary) As Dictionary(Of T, T2) Return dic.Cast(Of

Convert VB6 Scripting.Dictionary to .NET Generic Dictionary

喜夏-厌秋 提交于 2020-01-02 13:58:11
问题 Currently im working on wrapping and converting some old VB6 code to .NET and i need to be able to use the scripting.dictionary returned by huge old price of VB6 code. I want to convert this to the .NET generic Dictionary(Of TKey, TValue) 回答1: The solution is to write an extension method for scripting.dictionary to convert to a .net Dictionary(Of TKey, TValue) VB.NET <Extension()> Public Function ToDictionary(Of T, T2)(dic As Scripting.Dictionary) As Dictionary(Of T, T2) Return dic.Cast(Of

Does Scripting.Dictionary's RemoveAll() method release all of its elements first?

Deadly 提交于 2020-01-02 13:47:59
问题 In a VB6 application, I have a Dictionary whose keys are String s and values are instances of a custom class. If I call RemoveAll() on the Dictionary , will it first free the custom objects? Or do I explicitly need to do this myself? Dim d as Scripting.Dictionary d("a") = New clsCustom d("b") = New clsCustom ' Are these two lines necessary? Set d("a") = Nothing Set d("b") = Nothing d.RemoveAll 回答1: Yes, all objects in the Dictionary will be released after a call to RemoveAll() . From a

vb6 winhhtp: Error Occurred in the Secure Channel Support

三世轮回 提交于 2020-01-02 10:01:34
问题 I wrote a VB6 program which uses winhttp.dll to send and receive messages to/from a remote server. It has been working fine from various operating systems: Windows 2000, WinXP, Win7, Win8. Recently the server provider informed me that they will " phase out support of SHA-1 security certificates " and i need to " check that the thumbprint is aligned to SHA-2 new SSL cert. ". What is happening now is that when my program runs on WinXP,7,8 - it's still OK. But when running on Windows 2000, when

Working with VBA on Eclipse IDE [duplicate]

心已入冬 提交于 2020-01-02 08:13:10
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Any cheap or free IDE’s out there for VB6 programming? We plan to write complex VB6 projects. Now, when the legit MS Visual Studio 6 is scarce, in our organization we need to look for alternative environments. The paradigm of VBA, i.e. having all code embedded into a single xlsx/docx file is insuficient for our purposes. We also need some sort of bug tracking. I know that Eclipse and VBA are just two separate

How do you handle errors in error handlers in VB6?

£可爱£侵袭症+ 提交于 2020-01-02 05:28:26
问题 I frequently encounter this situation in my VB6 applications Private Sub DoSomething On Error Goto err1 Call ProcessLargeBatch1 Call ProcessLargeBatch2 '... more ...' Exit Sub err1: Call Cleanup 'Specific for DoSomething' Call HandleError 'General error handling: Logging, message box, ...' End Sub The Cleanup procedure sometimes reverts actions, rolls back a transaction, deletes temporary files, and so on. In most cases this operation can also fail. What do I do in this case? I'd add an On

pass adoconnection from vba to delphi

▼魔方 西西 提交于 2020-01-02 04:54:19
问题 I'm looking to create a COM object in a VBA macro and then pass it to a Delphi DLL (D2009). What should my procedure declaration in Delphi look like? Background: I'm expecting (hoping) the VBA macro to: create the COM object, invoke the Delphi DLL, pass the COM object to the Delphi DLL procedure, stay alive until the Delphi DLL closes itself (the DLL will have embedded forms for the user to interact with). I think I'll need to create a callback function to let the VBA macro know that I'm done