HomeActive Query Builderweb interface

web interface


Can this product be used to give a user the ability to build queries over the web? Where the DB is on the web server, and the user interacts with AQB via a web page?
Maurice McIver | email
October 18 2007, 02:44 PM
Dear Maurice,

Yes, using the ActiveX Edition of Active Query Builder at the web-page is very possible. A quick demonstration of such use can be found at this web page: http://www.activequerybuilder.com/livedemo.html

I believe that the best solution for web is not to connect to the database server at all, because this is not safe and also it may take a long time to load the component. Thus, we implemented ability to work "in Offline mode", i.e without live database connection at all. To do so, you should prepare the metadata information (list of available tables, their fields and relationships), save it to XML file and place this file to your web server.

This is ver simple. You may generate the XML file in several ways:
1) Download the Demo application from http://www.activequerybuilder.com/files/aqb_demo.zip, setup connection to your database and open the Metadata Container Editor from the main menu, "Metadata", "Edit...". In the editor, click on the Load button and follow the Metadata Load Wizard instructions. After loading of all meatdata from your database, you may remove some unwanted objects and their fields so they not be visible to the user.
Finally, you should Save metadata to XML file with appropriate button.
2) You may do the same things programmatically. Create a desktop project and place Active Query Builder on a form and prepare the database connection string for your database. Add a button and place the following code to the OnClick event handler:

QueryBuilder.WorkOffline = True; //
QueryBuilder.ConnectionString = 'your connection string here';
QueryBuilder.Connect;
QueryBuilder.MetadataContainer.SaveToXMLFile('filename');

After generation of the XML file and placing it on your web-site, you may use the following code to start working with Active Query Builder:

<body onload="OnLoadMetadata()">

<SCRIPT LANGUAGE="JavaScript">
function OnLoadMetadata(){
window.document.Form1.qb.MetadataContainer.LoadFromXMLFile("http://www.activequerybuilder.com/files/northwind.xml");
}
</SCRIPT>

And don't forget to set the WorkOffline property to True:

<PARAM NAME="WorkOffline" VALUE="-1">

You may find an examples of HTML pages with Active Query Builder at the Demos\HTMLDemo folder (included in the installation package).

Should you have any further questions, please do not hesitate to ask them here.

Sergey
Sergey Smagin | email
12 hours, 51 mins since original post
We're making good progress. we can build the queries and we know how to send the sql statement back to the db to execute the query. How do we save the query definition? We want to allow the user to save their queries, and to pull them up and edit them again. Please keep in mind were in a web environment here. Any sample code that works with c# would be most welcome.
Thanks a bunch
Maurice McIver | email
5 days, 19 hours since original post
Dear Maurice,

Active Query Builder is a two-way query builder, so you may simply assign your previously saved SQL code to the SQL property. Actually, the same is made in every demo project, each time the user changes SQL code in the text editor and goes back to the query builder.

Sergey
Sergey Smagin | email
5 days, 21 hours since original post
That's very encouraging Sergey. Actually, we did not find that the visual builder updated the query when we changed the sql string. Perhaps that's just because we're in a web environment and the event did not fire.

Is there any technical documentation that covers this software?
Maurice McIver | email
5 days, 22 hours since original post
Dear Maurice,

Very strange. Can you see the query builder is updated on the Live Demo page at http://www.activequerybuilder.com/livedemo.html ?

Here is a code from this demo:

<TEXTAREA ... id="sql" name="sql" onblur="LoadSQLinQueryBuilder(window.document.Form1.sql.value)">
</TEXTAREA>

<SCRIPT LANGUAGE="JavaScript">
function LoadSQLinQueryBuilder(sql){
window.document.Form1.qb.setAttribute("SQL",sql);
}
</SCRIPT>

The Help file is included in the installation package. Unfortunately, it does not cover the newly added features, but this ability was present in the component from the very beginning.

Sergey
Sergey Smagin | email
5 days, 23 hours since original post
Hi Sergey,
Is it possible to have query builder for web by using Active Query Builder for .NET, my client is not ready to use ActiveX control, thats why I am asking this question.
Kavitha | email
1 week, 4 days since original post
Dear Kavitha,

No, the .NET Edition of Active Query Builder is designed for Windows.Forms environment, ASP.NET Edition will be available next year.

Sergey
Sergey Smagin | email
1 week, 4 days since original post
Hi Sergey,

Thank you very much for the reply. May I know the expected release month of .NET edition for web pages?

~Kavitha
Kavitha | email
2 weeks since original post
Unfortunately, not very soon. May be, it will be ready at Summer of 2008.
Sergey Smagin | email
2 weeks, 2 days since original post
The ASP.NET version is finally released. see the http://www.activequerybuilder.com/product_asp.html for details.
Sergey Smagin | email
2 years, 4 months since original post
This topic is closed