in the Visual Basicv 6 IDE used to work so easily before all the security updates from MS made it a lot harder.
I had an idea for a web app that I could run on my webserver here, but wanted the flexibility of single-stepping through my code in VB6 instead of having to put lots of response.write statements in the classic asp code.
Basically, calling an ActiveX DLL requires the following code in the asp page:
<%
Dim oObject
Set oObject = Server.CreateObject("Project1.Class1")
Response.Write oObject.DoSomething
Set oObject = nothing
%>
That's all the asp page needs to be - the rest of the code is in the Class1 module of the Project1 project. All fine so far.
So anyway, to be able to actually debug in the VB6 IDE, you need to follow the instructions here:
But I still couldn't get it to work. Here's my solution:
Put a breakpoint on a line of code in your AxDLL.
Start your project (Ctrl-F5)
Start Regedit.
Find the Project1.Class1 key in HKLM\Software\Classes
Right click it.
Select Permissions.
Click Add.
Type "everyone" (the everyone group)
Click Ok.
Select the Everyone entry.
Click the Allow checkbox to the right of the Full Control label.
Click Ok.
Browse to the asp file in a web browser.
With any luck, the VB6 IDE will now be active and you can step through the code.
Press F5 to continue running and return the result back to the asp page.
You should see your results.
Now, stop your project.
Refresh the RegEdit page.
See how the Project1.Class1 entry has disappeared? Bummer isn't it? You'll have to go through the process of granting Everyone Full Control each and every time you run your AxDLL project, but hey, its a small price to pay to get it to break in the IDE from your asp page.
Hope this helps someone, somewhere.
Oh! And by the way, this is only meant for development on your local machine. Once you've got the AxDLL finalised, you can then compile and register it for real on your web server machine. Once you've done that, you'll need to give full rights to the HKLM\Software\Classes Project1.Class1 key to IUSR_???? and the NETWORK service - I think. Please correct me if I'm wrong.
Various stuff about stuff - I have no idea of audience so if something you read here helps you, then I'm glad.
Showing posts with label visual basic 6. Show all posts
Showing posts with label visual basic 6. Show all posts
Saturday, December 06, 2008
Sunday, July 13, 2008
Crystal Reports 9, Visual Basic 6 and Firebird
What is it with CR9?
All I'm trying to do is report on some records where my DATE_ADDED field is between two dates.
So I add a RecordSelectionFormula:
{DATE_ADDED} in date(2008,7,12) to date(2008,7,13)
but my OLE DB provider, Sibpro2.dll, gives me an error with the CONVERT function unknown.
I guess CR9 is generating a SQL statement that includes the unknown CONVERT function - probably valid if I'm using SQL Server (argh! Microsoft strikes again with non standard SQL extensions!) but I'm using Firebird.
Blah.
And I have to get this finished this afternoon.
All I'm trying to do is report on some records where my DATE_ADDED field is between two dates.
So I add a RecordSelectionFormula:
{DATE_ADDED} in date(2008,7,12) to date(2008,7,13)
but my OLE DB provider, Sibpro2.dll, gives me an error with the CONVERT function unknown.
I guess CR9 is generating a SQL statement that includes the unknown CONVERT function - probably valid if I'm using SQL Server (argh! Microsoft strikes again with non standard SQL extensions!) but I'm using Firebird.
Blah.
And I have to get this finished this afternoon.
Subscribe to:
Posts (Atom)