|  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 | 
 | 
  | 
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 | 
 | 
  | 
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 | 
 | 
  | 
Nathan 
Veteran Member 
     
  
  
Yeah, "large dimensions" ;)
  
Posts: 2978 Reputation: 76 
– /   /   
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   )  
 |   
 | 
| 07-08-2006 09:30 PM | 
 | 
  | 
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 | 
 | 
  | 
cloudhunter 
Senior Member 
    
  
 
Posts: 536 Reputation: 18 
38 / – / – 
Joined: Dec 2005 
 | 
| 
 RE: DATABASE?
 Would help if you posted your code... 
 
Cloudy 
![[Image: cloudy.jpg]](http://img.photobucket.com/albums/v383/marissaok/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
  
7255 days, 8 hours, 22 minutes, 9 seconds ago  
 |   
 | 
| 07-17-2006 01:44 AM | 
 | 
  | 
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 | 
 | 
  | 
-dt- 
Scripting Contest Winner 
     
  
  
;o
  
Posts: 1818 Reputation: 74 
37 /   /   
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-.
       Happy Birthday, WDZ 
 |   
 | 
| 07-17-2006 11:03 AM | 
 | 
  | 
RaceProUK 
Elite Member 
     
  
  
 
Posts: 6070 Reputation: 57 
40 /   /   
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.
 |   
 | 
| 07-17-2006 12:17 PM | 
 | 
  | 
-dt- 
Scripting Contest Winner 
     
  
  
;o
  
Posts: 1818 Reputation: 74 
37 /   /   
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  
       Happy Birthday, WDZ 
 |   
 | 
| 07-17-2006 12:22 PM | 
 | 
  | 
| 
Pages: (3): 
« First
  
 [ 1 ]
 2
 3
 
»
 
Last »
 | 
| 
 |