If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Transfer data between MSSQL and Access with vbscript

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-08-09, 08:34
Mangla Mangla is offline
Registered User
 
Join Date: Jun 2009
Posts: 1
Transfer data between MSSQL and Access with vbscript

Hello.

I have a problem with transfering data from MSSQL Server 2005 to Access.

I need to make a VBScript that can take out all data from one table in mssql and update one table in Access.

The tables exist in both databases and looks the same, but there can be more information in the table from MSSQL Server so i will need to update the table in Access with this information.

E.g.
I have a table called: SMP_Alert in both database's. So what i want to do something like this (dunno if that is possiable):

Set objConMSSQL = CreateObject("ADODB.Connection")

conMSSQL = "Provider=SQLNCLI;Server=127.0.0.1\SMP;Database=SM P;Uid=SA; Pwd=smp;"

objConMSSQL.Open(conMSSQL)

strSQL = "SELECT * INTO
[Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\SMP\DB\SMP.mdb;Persist Security Info=False].[SMP_ALERT]
FROM
[Provider=SQLNCLI;Server=127.0.0.1\PMS;Database=SMP ;Uid=SA; Pwd=smp;].[smp.dbo.SMP_Alert];"

objConnectionMSSQL.Execute(strSQL)

objConnectionMSSQL.Close


Or do i need to create a recordset of the table (SMP_Alert) from MSSQL, and loop through it to transfer the information into the table in Access?
If so how would that look like?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On