DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Using databases in Diadem

Hello,

 

can annybody name some good example of how to access databases in Diadem? I read a lot in the manuals, contacted support but nothing really worked out for me.

 

I currently use mySQL which is running locally on my machine. I got some ODBC System DSN set up which were tested running.

 

I tried using the SQL_Connect command. It reports that it couldn't find the database. The support said it could be a syntax error (?????). Is this command only usable for .mdb files?

 

I read about the CreateObject("ADODB.Connection") but I do not know how this should work in total.

 

Has anybody some hints, examples or tutorials of how to connect to a mySQL database in which way ever.

 

BR

Chris

0 Kudos
Message 1 of 4
(5,552 Views)

Chris

 

The following script should work from mysql.   You may not have the Mysql ODBC 5.1 driver installed on your machine. Should be able to google and find that.

 

The other settings should be able to be found from the ODBC DSN setup values, or the MySql settings.

Of course you will need to change the select string to fit your tables.

 

Paul

 

ps The code was obtained from

http://stackoverflow.com/questions/1366516/connect-to-mysql-5-0-database-using-pure-vbscript

 

dim cn, rs

i = 0

set cn = CreateObject("ADODB.Connection")

set rs = CreateObject("ADODB.Recordset")

connectionString = "Driver={MySQL ODBC 5.1 Driver};Server=localhost;Data Source=dsn_hb; Database=TP;User=root; Password=venu;"

cn.Open connectionString

rs.open "select * from test.Login", cn, 3

rs.MoveFirst

'msgbox rs(0)'

while not rs.eof

    msgbox rs.Fields(0)

    rs.MoveNext

wend

cn.close

MsgBox  "End of program"

 

0 Kudos
Message 2 of 4
(5,547 Views)

You should defenetively use ADO instead of the SQL_... commands

 

Option Explicit
call ADOConStrGet()
MsgBox AdoConString

 shows the MS connection dialog. It is possible to check if it can be connexted inside the dialog.

The ADOConString contains the string that is equal to the one configured in the dialog.

 

The string can be used to connect to ADO. DIAdem contains an "ADO example".

Important is the

ArrayToChannels

 method because it can be used to effectively transform a select result into DIAdem channels.

0 Kudos
Message 3 of 4
(5,510 Views)

Hi Chris,

 

does the question still exist or did the replies from Pesmith8 and AndreasK answer it?

Regards,

Julia

0 Kudos
Message 4 of 4
(5,456 Views)