What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » DATABASE?

Pages: (3): « First [ 1 ] 2 3 » Last »
DATABASE?
Author: Message:
Ruwen
Junior Member
**


Posts: 18
Joined: Jul 2006
O.P. DATABASE?
Is there not a database or something.. and how do i call things from it.. and save in it?

Even, how do i change something in it.. if i /mpm <password>
then it put/change <password> in the database..
07-08-2006 09:20 PM
Profile E-Mail PM Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
RE: DATABASE?
what?
The previous sentence is false. The following sentence is true.
07-08-2006 09:24 PM
Profile PM Find Quote Report
Ruwen
Junior Member
**


Posts: 18
Joined: Jul 2006
O.P. RE: DATABASE?
If i use a function call.. milkedtoday

lets say i want it to be 0 in the database.. how do i change it to 1.. or if it is null then add it to 1

quote:
Originally posted by Nathan
I think he means he wants to call a database for data, and a password field(maybe) to login to it.
If you see what i mean

Correct
07-08-2006 09:28 PM
Profile E-Mail PM Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: DATABASE?
I think he means he wants to call a database for data, and a password field(maybe) to login to it.
If you see what i mean

Ooops I deleted it cos i thought it was wrong :$ (reposted ;))
Touch Innovation - touch friendly programs/applications for the windows mobile!


07-08-2006 09:30 PM
Profile E-Mail PM Web Find Quote Report
Griffo
Junior Member
**


Posts: 27
Joined: Apr 2006
RE: DATABASE?
I would appreciate some info on this to. As I currently cannot connect to my database through JScript, I have to hard code it into my DLL, which isn't what I want to do as the path to the database may change. But when I try and pass the path to the DLL for it to connect to the database, I get an error stating "object variable or with block not set". Any suggestions?
07-16-2006 04:22 PM
Profile E-Mail PM Web Find Quote Report
cloudhunter
Senior Member
****


Posts: 536
Reputation: 18
37 / – / –
Joined: Dec 2005
RE: DATABASE?
Would help if you posted your code...

Cloudy
[Image: cloudy.jpg]
Sig by pirateok/marisaok/marisa ;)
quote:
Originally posted by Moulin Rouge
The greatest thing you'll ever learn, is just to love and be loved in return

6910 days, 1 hour, 28 minutes, 10 seconds ago
07-17-2006 01:44 AM
Profile E-Mail PM Find Quote Report
Griffo
Junior Member
**


Posts: 27
Joined: Apr 2006
RE: DATABASE?
Well I am using a DLL to do it, but here you go...

SCRIPT:
code:
var Shell = new ActiveXObject("WScript.Shell");
var MyActiveXObject = new ActiveXObject('RSP2MusicDLL.clsRSP2Music');
Shell.RegRead(MsgPlus.ScriptRegPath + "RSPpath");
var path = Shell.RegRead(MsgPlus.ScriptRegPath + "RSPpath");
var start = Shell.RegRead(MsgPlus.ScriptRegPath + "RSPenable");
   
    if(start == -1)
    {
    MyActiveXObject.SetPath(path);
    MsgPlus.AddTimer("RefreshTimer", 2000);
    }

DLL:
Global Vars:
code:
Dim DB As Database
Dim RS As Recordset

Load Precedure:
code:
Public Sub SetPath(strPath As String)
'Setup database settings
Set DB = OpenDatabase(strPath)
Set RS = DB.OpenRecordset("SELECT * FROM OnAir ORDER BY FullName ", dbOpenDynaset)
End Sub

The line that it errors on is in the timer, which is...
code:
var RSPArtist = MyActiveXObject.GetRSPArtist();
07-17-2006 09:43 AM
Profile E-Mail PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: DATABASE?
it seems you're using a microsoft access database... so why not use COM to open it in jscript

an example of opening , fetching some data and closing the database
code:
var db = new ActiveXObject('ADODB.Connection');
var dbPath = "C:\\Program Files\\Messenger Plus! Live\\Scripts\\test\\db1.mdb";
db.open("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" + dbPath +";DefaultDir=;UID=;PWD=;");

var results = db.Execute("SELECT * FROM xxx");

var xxx = resultsToArray(results);

for(var i=0;i<xxx.length;i++){
    Debug.Trace("Row: " + i);
    for(x in xxx[i]){
        Debug.Trace(x + " : " + xxx[i][x]);
    }
}

db.close();


function resultsToArray(result){
    var res = new Array();
    while(!result.EOF){
        var row = {};
        for(var enume = new Enumerator(result.Fields);!enume.atEnd();enume.moveNext()){
            row[enume.item().name] = enume.item().value;
        }
        res.push(row);
        result.MoveNext();
    }
    return res;
}


This post was edited on 07-17-2006 at 11:05 AM by -dt-.
[Image: dt2.0v2.png]      Happy Birthday, WDZ
07-17-2006 11:03 AM
Profile PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: DATABASE?
quote:
Originally posted by -dt-
so why not use COM to open it in jscript
The other possibility is ADO, which can be used directly in JScript, and is compatible with more database types than just Access.

This post was edited on 07-17-2006 at 12:17 PM by RaceProUK.
[Image: spartaafk.png]
07-17-2006 12:17 PM
Profile PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: DATABASE?
quote:
Originally posted by RaceProUK
quote:
Originally posted by -dt-
so why not use COM to open it in jscript
The other possibility is ADO, which can be used directly in JScript, and is compatible with more database types than just Access.
:-/ i used ADO
[Image: dt2.0v2.png]      Happy Birthday, WDZ
07-17-2006 12:22 PM
Profile PM Web Find Quote Report
Pages: (3): « First [ 1 ] 2 3 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On