Hi Hi,
I have started to move some of my scripts to functions for ease of programming, since it seems to make it easier both to determine where errors exist, but also allows me to reuse the functions in other scripts thus speeding up my programming requirements.
I have moved a File writer to function (which i admit is probably overkill), I have alot of regex moved across to functions as well, with many different regex's extracting and returning a fair amount of information.
However now i want to start using the information more effectively, and to do this i need to start to put it in a database.
I do have database scripts, however I am wondering if anyone has a database function they use in their scripts. I wonder if it is even really feasible to put a database (insert) component in a function?
Just curious how people most efficiently work around databases, or is it just a case of having lots of insert, update, or delete sections in your scripts where-ever they may be required.
My thought was a function could be done along the lines of:
Public Function Write2DB(DatabaseFile as String, TableName as String, FieldstoInsertInto as String, ValuestoInsert as String)
Then have it so that if you wanted to insert into a table multiple entries you might just seperate them by |, so for example Write2DB("ExampleDB.mdb","Example_Table","Field1|Field2|Fiel d3|Field3","1|abcde|10:59|2|b")
Thanks
I have started to move some of my scripts to functions for ease of programming, since it seems to make it easier both to determine where errors exist, but also allows me to reuse the functions in other scripts thus speeding up my programming requirements.
I have moved a File writer to function (which i admit is probably overkill), I have alot of regex moved across to functions as well, with many different regex's extracting and returning a fair amount of information.
However now i want to start using the information more effectively, and to do this i need to start to put it in a database.
I do have database scripts, however I am wondering if anyone has a database function they use in their scripts. I wonder if it is even really feasible to put a database (insert) component in a function?
Just curious how people most efficiently work around databases, or is it just a case of having lots of insert, update, or delete sections in your scripts where-ever they may be required.
My thought was a function could be done along the lines of:
Public Function Write2DB(DatabaseFile as String, TableName as String, FieldstoInsertInto as String, ValuestoInsert as String)
Then have it so that if you wanted to insert into a table multiple entries you might just seperate them by |, so for example Write2DB("ExampleDB.mdb","Example_Table","Field1|Field2|Fiel d3|Field3","1|abcde|10:59|2|b")
Thanks
Comment