Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsMapMapcustom query and connection string examplescustom query and connection string examples
Previous
 
Next
New Post
12/9/2008 8:16 PM
 

Can anyone provide an example or two of a custom query and connection that actually works?  I'm unclear what they are meant to look like and from reading posts it sounds like many people are giving up on the module... which is a bummer.

thanks

 
New Post
12/11/2008 8:52 AM
 

I second this, please show us how to use it.

 
New Post
12/11/2008 10:13 AM
 

Custom Queries are defined and a sample is provided starting on page 28 of the documentation. If you have not yet looked there:

How To: Custom Queries

Custom Query sources provides the ability to select data for your points from external sources. The base requirement for this is the simple fact that your external source will provide its own Longitude and Latitude. Please refer to the Map_Points table which defines the require columns. Your external source query MUST result in the required data structure. Additionally, with Custom Query you may add any number of Query Variables to be consumed within the Query. This provides the ability to create a robust and interactive search mechanism or direct lookup and plotting of your records based on incoming parameters from your user.

To use an existing source for your data that will not be managed by the Map Points table, or to provide some extended functionality of the incoming forms and parameters for your pages (like custom filtering), you can create a Custom Query data source.

First – in the Data Sources page, select Custom Query. This can only be specified when the user is a Super User, otherwise, you cannot manipulate or gain access to the SQL interface.

Next, specify the Query. The only requirement of the query is that it return a table structure that contains all of the existing columns expected from the Map_Points table. You may include other columns, but the default columns are required specifically. Any incoming variables you will need can be setup with the Query Editor region. It will use a standard String Replacement technique for using your variables, so make sure that the Target of the variable and the value of your source are setup properly.

If you data source is external, you may use any ODBC or OleDB connection string to connect to that external source.

The provided list below is a breakdown of example Connection Strings from well known Database Management Systems.


Access

·         Default
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\path\dabasename.mdb;User Id=admin;Password=;

·         Password Protected
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\path\dabasename.mdb;Jet OLEDB:Database Password=passwordValue;

 

Active Directory

·         Provider=ADSDSOObject;User Id=Username;Password=PasswordValue;

 

AS/400 (iSeries)

·         PROVIDER=IBMDA400; DATA SOURCE=SOURCE_SYSTEM;USER ID=Username;PASSWORD=PasswordValue;

 

DBF / FoxPro

·         Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\path;Extended Properties=dBASE IV;User ID=Admin;Password=OptionalPasswordValue;

 

DSN

·         Default
DNS=DsnName;Uid=Username;Pwd=OptionalPasswordValue;

·         File DSN
FILEDSN=C:\Path\File.dsn;Uid=Username;Pwd=OptionalPasswordValue;

 

Excel

·         Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Path\FileName.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1

Firebird

·         User=Username;Password=PasswordValue;Database=DatabaseFileName.fdb;DataSource=ServerName;Port=3050;Dialect=3;Charset=NONE;Role=;Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0;

 

IBM DB2

·         Provider=DB2OLEDB;Network Transport Library=TCPIP;Network Address=IP ADDRESS;Initial Catalog=SourceCatalog;Package Collection=SourceCollection;Default Schema=Schema;User ID=Username;Password=OptionalPasswordValue;

 

Informix

·         Provider=Ifxoledbc.2;password=OptionalPasswordValue;User ID=Username;Data Source=DatabaserName@Server_Name;Persist Security Info=true;

 

Ingres

·         Provider=MSDASQL.1;DRIVER=Ingres;SRVR=SERVER;DB=DATABASE;Persist Security Info=False; uid=UserName; pwd=OptionalPasswordValue; SELECTLOOPS=N; Extended Properties="SERVER=SERVERNAME; DATABASE=DATABASENAME; SERVERTYPE=INGRES"

Interbase

·         provider=sibprovider;location=server:;data source=c:\path\dabasename.gdb;user id=UserName;password=OptionalPasswordValue

 

MySQL

·         Provider=MySQLProv;Data Source=DatabaseName;User Id=Username;Password=OptionalPasswordValue;

 

Oracle

·         Default (Microsoft)
Provider=msdaora;Data Source=OracelDatabaseName;User Id=Username; Password=OptionalPasswordValue;

·         Default (Oracle)
Provider=OraOLEDB.Oracle;Data Source=OracelDatabaseName;User Id=Username; Password=OptionalPasswordValue;

·         Trusted Connection
Provider=OraOLEDB.Oracle;Data Source=OracelDatabaseName;OSAuthent=1;

 

Paradox

·         Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\DatabaseName;Extended Properties=Paradox 5.x;

 

Pervasive

·         Provider=PervasiveOLEDB;Data Source=C:\Path

SQL Server

·         Provider=sqloledb;Data Source=DataSourceName;Initial Catalog=DatabaseName;User Id=Username;Password=OptionalPasswordValue;

·         Provider=sqloledb;Data Source=IPADDRESS,1433;Network Library=DBMSSOCN; Initial Catalog=DATABASENAME; User ID=Username; Password=OptionalPasswordValue;

 

Sybase

·         Adaptive Server Anywhere (ASA)
Provider=ASAProv;Data source=ASADataSourceName

·         Adaptive Server Enterprise (ASE)
Provider=Sybase.ASEOLEDBProvider;Srvr=SERVERNAME,5000; Catalog=DATABASENAME;User Id=Username; Password=OptionalPasswordValue

 

Text

·         Delimited Columns
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Path\;Extended Properties="text; HDR=Yes; FMT=Delimited”

·         Fixed Columns
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Path\;Extended Properties="text; HDR=Yes; FMT=Fixed"

Visual FoxPro

·         Database
Provider=vfpoledb.1;Data Source=C:\Path\FileName.dbc;Collating Sequence=machine

·         Table Directory
Provider=vfpoledb.1;Data Source=C:\Path\;Collating Sequence=general

·         ODBC DSN
Provider=vfpoledb.1;DSN=DSNNAME

 

How to use the Custom Query


As provided in the above screen, a simple example of the use of the Custom Query functionality is presented. Two Query Variables were created that persist the Latitude and Longitude of the current Map view to display points relative to that area.

Type - The following types of variables can be utilized:

Session – values contained in the session. The Source consists of the key value f the session variable (Case Sensitive).

Querystring – values contained in the incoming request url. The Source consists of the key value from the query string parameter (Case Sensitive).

form – values contained in the incoming form request. The Source consists of the NAME value of the form element from the request. Be sure that NAME is the source of your element and not the ID value.

TabID / ModuleID / PortalID / UserID – parameters provided directly by DotNetNuke. Source is ignored for these attributes.

Latitude / Longitude – the coordinates on the interface that are currently the center of the map.

Target – the value that will be replaced within your query with the value bound to your Type/Source. The default use of this is via SQL-like syntax. For example: @Latitude.

Left / Right – If you variable source contains a value – the output of that value will be placed between the Left and Right values. For example – single quotes for non numeric values. When the value is empty, the left and right are not consumed.

Empty Value – when your source contains NO value, the output is provided via the Empty Value.

Security – this enforces the check for SQL Injection. It is recommended that this is always used. The end behavior of this is that all variables replace single quotes with escaped single quotes.

 


 

 



Kevin M Schreiner
[P] 410.327.0007 [F] 410.327.4082 | info@r2integrated.com
 
New Post
12/11/2008 5:26 PM
 

Thank you for the quick response.  I have read the documentation but it did not work, that was why I was looking for a working example.  I still cannot make this work.  To make things simple I tried to read directly from the map_points table... once with a connection string and once without (dnn directly).  It works fine without the connection string as expected, but if I attempt to use my own connection string into the same database, table and query... when clicking data it reads... 'fetching data' forever.  Here is the query:

select *
from map_points where map_points.sourceid=2

Here is the connection string:

Data Source=MSSQL.MYPROVIDER.com;Initial Catalog=MYDATABASE;User ID=MYUSER;Password=MYPASSWORD

On this same page I accessed this table (map_points) via a database module I use, indooGrid, with the same connection string without any problem. Am I making some kind of stupid mistake here?  I'm driving myself crazy trying to figure out what I'm doing wrong?

Any help is appreciated... thanks

 
New Post
12/13/2008 12:06 PM
 

I will take a look at this, the connection string looks correct, but it may be something else going on. First - make sure you are logged in as the host when you are making these changes.



Kevin M Schreiner
[P] 410.327.0007 [F] 410.327.4082 | info@r2integrated.com
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsMapMapcustom query and connection string examplescustom query and connection string examples


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out