Mostrando postagens com marcador VB6. Mostrar todas as postagens
Mostrando postagens com marcador VB6. Mostrar todas as postagens

quarta-feira, 6 de agosto de 2014

Some considerations - Sybase, VB6, Crystal Reports, Windows 8

Is Sybase, VB6, Crystal Reports and Windows 8 a feasable scenario?

You should get rid of VB6 and Crystal Reports as soon as possible, but yes, all together they work.

With a lot of problems but they work.

Remember SAP owns Sybase and Crystal. They will tell you that if the scenario above is your scenario, then you are in deep s*t (like me).


Does Crystal Reports 8 works with Windows 8? Yes, with a lot of limitations. Again, get rid of this version as soon as possible. Migrate to XI.

What is the minimum version of Sybase Client suitable for Windows 8? Version 15. That's it.
 But there's a catch. There's no more a ODBC driver. Don't try to force an ODBC driver, ok? Instead, you'll have to figure out how to work with the driver Adaptive Server.

What if I decide to migrate all my reports to Reporting Services (rdl format)?
That's the one million dollars question.

1 - RPT Crystal Reports can't be converted to RDL. There's no magical machine that will do that to you. You'll have to rebuild the reports from scratch (Oh, that was cruel, I know).

2 - Sybase Store Procedures and Reporting Services don't work well together. It seems that there's something in the DNA of Sybase Database that hates Microsoft technology. So, if you are using Sybase and you want to try Reporting Services, you will probably have a lot of weird problems (at least, that's my experience).

3 - There are complicated issues related to ODBC and OLEDB when it comes to Reporting Services. Sometimes the server application don't recognize the drivers installed in the server macine. In my case, the server application couldn't recognize the adaptive driver of Sybase.

OK, and what is the solution!!!! That's what you are screeming right now. Well, I don't know. I didn't mirate. I'm struggle with my scenario and doing the best I can.
All I can do is share my experience with you so you save time (and money).

And that's it folks!

If you have questions, write them down on the comments section.

Bye!






quarta-feira, 16 de abril de 2014

This is gonna blow your mind - Operation System Identification

You know there's a lot of  routines to identify Operation System, but none of them are as classy or as elegant as the following one.

This code is not mine. My friend Cicero came to me with this code and found it fantastic!

I know it's VB6, it's old stuff. But with all this fuss about Operational System migration (people leaving Windows XP and adoptint Windows 7 and or Windows 8) I believe a code like that will be extremely useful.
Look at the elegance. Amazing!

Public Function MyOSVersion() As String
    Dim lstrResult As String
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", , 48)
    For Each objItem In colItems
        lstrResult = "OS Name: " & objItem.Caption & vbNewLine & "Version: " & objItem.Version
        Exit For
    Next
    MyOSVersion = lstrResult
End Function

Public Function isWindows8() As Boolean
      Dim lstrResult As String
      lstrResult = MyOSVersion
      isWindows8 = (InStr(1, lstrResult, "Microsoft Windows 8") > 0)
End Function


Public Function isWindowsXP() As Boolean
      Dim lstrResult As String
      lstrResult = MyOSVersion
      isWindowsXP = (InStr(1, lstrResult, "Microsoft Windows XP") > 0)
End Function

quinta-feira, 1 de agosto de 2013

How to call a excel macro from VB6

Very simple!

This is old stuff, nonetheless, useful stuff
 
Private Sub Command1_Click()
  Dim x As Object
    
   Set x = CreateObject("Excel.Application") ' Create excel object

    x.Workbooks.Open txtPath.Text  'Open File; ex: c:\abc.xls

    x.Visible = True 'Turn visible on

    x.Run txtMacro.Text  'Execute Macro - Keep in mind that you already know the name of the macro

End Sub

Há!

segunda-feira, 22 de julho de 2013

How to access MQSeries using VB6

Hi!

First of all you have to find the following reference and add to your vb project.

REFERENCE

IBM MQSeries Automation Classes for Activex

Once you did it, do the following

* * *

Sub AccessMQSeriesByNetdaniels()

On Error GoTo TrataErro

Dim MQSess As New MQSession
Dim QMgr As New MQQueueManager
Dim Queue As MQQueue
Dim msg As MQMessage
Dim pmo As MQPutMessageOptions
Dim MQDList As MQDistributionList

STEP 1
Set MQSess = New MQSession

Set QMgr = MQSess.AccessQueueManager("QM.000000.01")

MsgBox "I was able to connect to the queue manager"

STEP 2

Set Queue = QMgr.AccessQueue("QL.XXXXXXXXX.01", MQOO_INPUT_AS_Q_DEF, "QM.000000.01")

MsgBox "Queue was created"

STEP 3

Call msg.Write("Queue test" & Now)

MsgBox "I was able to write a message"

STEP 4

Queue.Open

MsgBox "I was able to open the queue"

STEP 5

Queue.Put msg

MsgBox "Put was successfully"

Exit Sub

TrataErro:

MsgBox Err.Description

End Sub

* * *  
Et voilà!


A very simple code for you to test your connection with MQSeries!


How simple is that?

How to call webbrowser from VB6 using API

To perform this task the code is extremely simple.

Private Declare Function ShellExecute _
                            Lib "shell32.dll" _
                            Alias "ShellExecuteA" ( _
                            ByVal hwnd As Long, _
                            ByVal lpOperation As String, _
                            ByVal lpFile As String, _
                            ByVal lpParameters As String, _
                            ByVal lpDirectory As String, _
                            ByVal nShowCmd As Long) _
                            As Long
Private Sub Command1_Click()
   Dim r As Long
   r = ShellExecute(0, "open", "http://www.microsoft.com", 0, 0, 1)
End Sub
 
 Really simple, isn't it?

quinta-feira, 11 de julho de 2013

Use .Net from VB6 (Interop Forms Toolkit)

Hi!

Sometimes you need to do something that is impossible when it comes to VB6. In those cases a possible solution is create a library in .Net.
The trick is to create a interop that will allow you VB6 application to access the .Net library.
When I need to do so, I use to use the interop forms toolkit.
Even though you see the word "forms", it's possible to call the library without activate any form.

Important: the toolkit comes in VB.NET programming language. For those who are accustomed to program in C# this fact could be annoying, but that's the way it is. Despite this fact, the toolkit works perfectly.

Interop Forms Toolkit

And that's all folks.