#84919 - 2002-02-07 03:05 PM
Re: Create/Read/Update MS Access Database
|
Breaker
Hey THIS is FUN
Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
|
You can use the SQL statement "CREATE TABLE", and specify fields and data types within this, eg "CREATE TABLE SOFTWARE (SOFTWARE_ID INTEGER NOT NULL, SOFTWARE CHAR(40) NOT NULL, PUBLISHER CHAR(40), LICENCES INTEGER);".This would create a table called Software, with four fields - Software_ID, Software, Publisher, Licences. The type of the data allowed is specified as well - integer, text(CHAR) where the entry length is also specified, and the NOT NULL expression shows that certain fields must be populated. For more info on SQL functions look here, or try the Access docs if you'll be using Access. I would have thought, given the example above, that the most efficient way to perform any DB admin would be independent of the data-gathering process. I suppose it depends on the size and complexity of your network... HTH That might not be exactly what you meant. Whoops! Are you thinking more of the archival process and the rebuilding of new tables, identical to the archived data? If so, building the tables, as shown above is not such a problem. The trickier part would be identifying your criteria for archival, and actually performing this process. I think (no SQL guru, me!) that you can rename a table, so maybe it would be a case of deciding when there was enough data, either by:
code:
If $Recordset.RecordCount > 1000 ;too many records! ArchiveTable($CurrentTable) ;possible set of DB admin UDF's coming on! Endif
Or parsing the Date field and deciding to archive when the data covers three months (or whatever!) HTH as well. [ 07 February 2002: Message edited by: Breaker ]
_________________________
================================================ Breaker
|
Top
|
|
|
|
#84921 - 2002-06-25 11:50 AM
Re: Create/Read/Update MS Access Database
|
JSchroeder
Fresh Scripter
Registered: 2002-06-24
Posts: 11
|
Ups ... your script is exiting at the point "if $Connection"
Any Ideas ?
Thanx
|
Top
|
|
|
|
#84924 - 2002-06-25 08:46 PM
Re: Create/Read/Update MS Access Database
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
It can depend on how your database is set up. I assume you require an answer for each question, so you can check to see if there is a value for the questions you asked, or you can create a new field that is set whenever information is written to the database for a certain user. Generically, the easiest way to check to see if someone has taken a poll is to check if their record exists (assuming you are generating a record when they take the poll.)
Brian
|
Top
|
|
|
|
#84926 - 2003-03-31 11:23 PM
Re: Create/Read/Update MS Access Database
|
Jhawk
Fresh Scripter
Registered: 2002-06-11
Posts: 12
Loc: KS
|
A couple of quick things.. first off, big thanks to Breaker! I ran into this script earlier today because someone asked for a script like this and he linked to this thread.
I put this script in place w/ a few minor variations, and I thought I would add one that a lot of people might have a need for.
Here goes.. I don't post much, so don't hate me if something goes wrong
The majority of our PC's are Dell, and dell likes to use "Service Tags"... these tags weren't being displayed in the serial number field, so I added the following statements.
Variables:
$ServiceTag = WMIQuery("serialNumber","Win32_SystemEnclosure") $AssetTag = WMIQuery("SmBiosAssetTag","Win32_SystemEnclosure"
Writes to the DB:
$Recordset.Fields("ServiceTag").Value = $ServiceTag $Recordset.Fields("AssetTag").Value = $AssetTag
At any rate, like I mentioned thanks a ton for the hard work it took to get this together Breaker!
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 259 anonymous users online.
|
|
|