T
Ted
Hi all,
I'm a total newbie w MS SQL Server. We're running SQL 2005 here w a new
system. I need to pull data from SQL into my Access 2007 Policy Issuance
system. Eventually I'll migrate this data to SQL too but for now its being
stored in a backend Access database. We have a contractor working in the
back-end of our new sytem. She's setting it up so that our users will enter
a quote ID from the new system pull in the data. I need to write code to
connect to the SQL Server to pull in the data associated with that Quote ID.
Can anyone recommend some sample code that can get me rolling? Or any sites?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
She offered me kind of an outline to get going...
1. declare and/or initiate some variables:
a.. one for the server name
b.. one for the database name ('CIS')
c.. one for the userid
d.. one for the password
e.. one for an error code from MSSQL (code not yet written - i haven't
quite gotten to error trapping yet - don't let me forget)
f.. one for each SQL Command you want to pass to the server which will
turn out to be one command per table, I believe a total of 8
(the first of these commands is the text contained in the file
spRCA_tblSNMain_Execute_11-07-2008.txt - you insert a quoteid variable where
I have a quoteid static value)
g.. one for each parameter you will need to pass along and/or receive,
including the quote number that the user inputs that u will use as described
above in the SQL Command
2. Connect to server w/ userid & password
3. select a database ('CIS')
4. pass the sql command(s) with the quote number variable embedded
5. insert the return values or datasets into access
6. store the access quoteid and other internal key values in a variable to
use for the next insert statement for the next table
7. perform any other stuff we come up with such as error trapping
8. close connections
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help would be very much appreciated
Ted
I'm a total newbie w MS SQL Server. We're running SQL 2005 here w a new
system. I need to pull data from SQL into my Access 2007 Policy Issuance
system. Eventually I'll migrate this data to SQL too but for now its being
stored in a backend Access database. We have a contractor working in the
back-end of our new sytem. She's setting it up so that our users will enter
a quote ID from the new system pull in the data. I need to write code to
connect to the SQL Server to pull in the data associated with that Quote ID.
Can anyone recommend some sample code that can get me rolling? Or any sites?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
She offered me kind of an outline to get going...
1. declare and/or initiate some variables:
a.. one for the server name
b.. one for the database name ('CIS')
c.. one for the userid
d.. one for the password
e.. one for an error code from MSSQL (code not yet written - i haven't
quite gotten to error trapping yet - don't let me forget)
f.. one for each SQL Command you want to pass to the server which will
turn out to be one command per table, I believe a total of 8
(the first of these commands is the text contained in the file
spRCA_tblSNMain_Execute_11-07-2008.txt - you insert a quoteid variable where
I have a quoteid static value)
g.. one for each parameter you will need to pass along and/or receive,
including the quote number that the user inputs that u will use as described
above in the SQL Command
2. Connect to server w/ userid & password
3. select a database ('CIS')
4. pass the sql command(s) with the quote number variable embedded
5. insert the return values or datasets into access
6. store the access quoteid and other internal key values in a variable to
use for the next insert statement for the next table
7. perform any other stuff we come up with such as error trapping
8. close connections
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help would be very much appreciated
Ted