473,473 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to transfer new data in ms.access to sql server

19 New Member
I have 2 databases, sql server and ms.access,
I want to move existing data in database ms.access to database sql server using looping

Expand|Select|Wrap|Line Numbers
  1. Dim jlhField As Long
  2.  
  3. Set rsSIKawan = New ADODB.Recordset
  4. Set rsDataRAS = New ADODB.Recordset
  5. Set rsSQL = New ADODB.Recordset
  6.  
  7.  QuerySelect = "SELECT a.DN, b.DIN, c.PIN, " & _
  8.                "c.UserName, b.Clock, d.ItemName " & _
  9.                "FROM ((ras_Device a INNER JOIN ras_AttRecord b ON a.DN=b.DN) " & _
  10.                "LEFT JOIN ras_Users c ON b.DIN=c.DIN) " & _
  11.                "LEFT JOIN ras_AttTypeItem d ON b.AttTypeId=d.ItemId " & _
  12.                "WHERE b.DIN=c.DIN"
  13.  Set rsDataRAS = da_GetRs(QuerySelect)
  14.  
  15.  'Mengambil data dari dbSIKawan
  16.  'QuerySelectSIKawan = "SELECT * FROM " _
  17.                     & "finger_data_karyawan"
  18.  'Set rsSIKawan = da_GetRecord(QuerySelectSIKawan)
  19.  
  20.  rsSQL.CursorLocation = adUseClient
  21.  
  22.  With rsSQL.Fields
  23.       .Append "idNo", adInteger
  24.       .Append "device", adInteger
  25.       .Append "idFinger", adInteger
  26.       .Append "nikKary", adVarChar, 50
  27.       .Append "namaKary", adVarChar, 100
  28.       .Append "time", adDate
  29.       .Append "tipeAbsen", adVarChar, 64
  30.  End With
  31.  
  32.  rsSQL.Open
  33.  
  34.     If rsDataRAS.RecordCount > 0 Then
  35.     jlhField = 0
  36.  
  37.        While Not rsDataRAS.EOF Or rsDataRAS.BOF
  38.              rsSQL.AddNew
  39.              rsSQL("idNo").Value = jlhField + 1
  40.              rsSQL("device").Value = rsDataRAS("DN").Value 'field device
  41.              rsSQL("idFinger").Value = rsDataRAS("DIN").Value 'field finger ID
  42.              rsSQL("nikKary").Value = rsDataRAS("PIN").Value 'field nik karyawan
  43.              rsSQL("namaKary").Value = rsDataRAS("UserName").Value 'field nama karyawan
  44.              rsSQL("time").Value = rsDataRAS("Clock").Value 'field waktu
  45.              rsSQL("tipeAbsen").Value = rsDataRAS("ItemName").Value 'field tipe waktu
  46.  
  47.             '06.10.2010
  48.             'simpan ke dbSIKawan
  49.              rsSQL.Update
  50.              rsDataRAS.MoveNext
  51.              jlhField = jlhField + 1
  52.  
  53.                     QueryInsertSIKawan = "INSERT INTO finger_data_karyawan " _
  54.                         & "(idNo, Device, idFinger, NIKKary, NamaKary, " _
  55.                         & "TglHadir, TimeIn, TipeAbsen) " _
  56.                         & "VALUES('" & rsSQL("idNo").Value & "', '" & rsSQL("device").Value & "', " _
  57.                         & "'" & rsSQL("idFinger").Value & "', '" & rsSQL("nikKary").Value & "', " _
  58.                         & "'" & rsSQL("namaKary").Value & "', " _
  59.                         & "'" & Format(rsSQL("time").Value, "mm/dd/yyyy") & "', " _
  60.                         & "'" & Format(rsSQL("time").Value, "mm/dd/yyyy h:mm:ss") & "', " _
  61.                         & "'" & rsSQL("tipeAbsen").Value & "')"
  62.  
  63.           DoEvents
  64.         Wend
  65.  
  66.     End If

The data made it into database sql server , but when I stop running and then run the application again, the same data/field/row back into the database sql server.
Hmm, I want each of the data/field/row already entered into a database sql server does not re-signed but the new data/field/row in ms.access that will be into database sql server as a new data/field/row

Can anyone help me to find solution in my problem?
please help me..

Regards,
Octo
Oct 12 '10 #1
0 1057

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Frnak McKenney | last post by:
Back when computer dinosaurs roamed the earth and the precursors to today's Internet were tiny flocks of TDMs living symbiotically with the silicon giants, tracking access to data processing...
1
by: r_burgess | last post by:
I am looking for some guidance on transferring data between two pages in my ASP.net Web app (intranet). I have a form that will have a button and a text box on it (among other controls of course)...
6
by: Hamed | last post by:
Hello I have employed as a developer in a software company that its team uses FoxPro / VB 6.0 / VC++ 6.0 as the developing tools and newly is going to migrate to VS.NET. There is a project...
3
by: phong.lee | last post by:
Hello all, i'm new at this. I need some assistant in transferring data from excel to access. I created a macro that basically gather all the necessary data that i need to bring into access. I...
3
by: Lyle Fairfield | last post by:
In a recent thread there has been discussion about Data Access Pages. It has been suggested that they are not permitted on many or most secure sites. Perhaps, that it is so, although I know of no...
15
by: http://www.visual-basic-data-mining.net/forum | last post by:
Does anyone have any idea how to transferring data from TextBox1 in form1 to textBox2 in form2..... That means after i fill in any data in textBox1 and click Next button... It will bring me to...
3
by: Marc Gravell | last post by:
Kind of an open question on best-practice for smart-client design. I'd really appreciate anyones views (preferably with reasoning, but I'll take what I get...). Or if anybody has any useful links...
2
hsriat
by: hsriat | last post by:
I have a page working on Ajax. The problem is, after doing many changes using Ajax (like uploading, changing name, adding to favorites etc), the status bar starts behaving unexpectedly. Even when...
3
by: angusfreefa | last post by:
Dear All, I am facing a problem of transferring data between 2 tables within the same database. I set up 2 tables. The first table is the permanent table (oos_table) for saving records. the...
35
computerfox
by: computerfox | last post by:
I'm writing a work order system using PHP and MySQL and I'm stuck on two things-transferring data and updating the data. Here is my code: i'm using checklogin.php to do most of everything so...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.