Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 12:04 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Does anyone speak... Scripting?
PostPosted: August 7th, 2006, 2:11 am 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
I have finally, after several years of using Opus/Illuminatus, learned how to link a nice UI to a MSaccess database using ODBC of course. I almost damaged my shoulder patting myself on the back. I’m a graphic artist by trade, so it took a long time for me to get this. So I'm very proud to have achieved this long time goal.

I’m now onto the second part which requires scripting. If someone will help me with the scripting, I’ll be glad to send you a Free copy of the program… actually its already free, but perhaps I’ll put you on my Christmas card list.

I have 26 buttons laid out and waiting, and would like to be able to click on one of those buttons… let’s say (D), and pull up all of the people in the database with the last name that starts with a D and etc. etc. NOTE: The field name is "LastName". I realize that I would need a 27th button to pull up everyone once again using the same query that starts the program.

If you (the person who is nice enough to help) would like to see the program it can be download here…

http://planet-denn.com/cgi-bin/download.cgi?download=pd-Base-v1-Setup.exe

or you can go to my site at http://planet-denn.com click on the freebies page and find it at the top of the main list.

I have spent a couple of years learning what I was doing wrong to finally complete the project to this point. I would be forever grateful for the script to achieve this final touch.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 7th, 2006, 6:37 pm 
Offline

Joined: April 1st, 2005, 6:59 pm
Posts: 98
Location: Maastricht, The Netherlands
Opus: V7
OS: Mac OS X 10.7.2 | Windows 8 Dev
System: i5 2.7 | 8G Ram | 1 T HD
Hi Denn,

Try this,

Code:
var db = new Database("FILEDSN=mydb.dsn");
var records = null;
var num_records = 0;

//////////////////////////////////////////////////////////////////////////////
//
// NOTE: Start_Record_Num is the record number for the first of the 5 records
//       and it is a Page Variable
//

function SearchDB()
{
   var sql = "SELECT * FROM Names WHERE First_Name LIKE '"+Name+"%' ORDER BY Surname;";
   //Name is a pub variable : set for each button from a to z the variable "a" etc.
   // Debug.trace(sql+"\n");
   records = db.ExecuteSQL(sql);
   num_records = records.GetNumberOfRecords();
   
   ShowRecords();
}
// This part of the code you must update to your needs//
function ShowRecords()
{
   if (records == null) {
      return;  // need to call Search First to get records
   }
   
   var list_box = Listbox_1;
   list_box.SetSelection(0, -1);   // Select all the old text
   list_box.ReplaceSelection("");   // Remove all the old text
   
   if (records.FirstRecord()) {
      list_box.ReplaceSelection(records.Surname+", "+records.First_Name);
      records.NextRecord();
      for (i=1; i<num_records; i++) {
         list_box.ReplaceSelection("\n"+records.Surname+", "+records.First_Name);
         records.NextRecord();
      }
   }
}


Hope this helps,

Cheers

Ronnie


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 7th, 2006, 7:19 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Ronnie,

I'm at work and just got this. I'll try it as soon as I get home.

Thanks so much.
Denn...

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 76 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group