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 - Dim jlhField As Long
-
-
Set rsSIKawan = New ADODB.Recordset
-
Set rsDataRAS = New ADODB.Recordset
-
Set rsSQL = New ADODB.Recordset
-
-
QuerySelect = "SELECT a.DN, b.DIN, c.PIN, " & _
-
"c.UserName, b.Clock, d.ItemName " & _
-
"FROM ((ras_Device a INNER JOIN ras_AttRecord b ON a.DN=b.DN) " & _
-
"LEFT JOIN ras_Users c ON b.DIN=c.DIN) " & _
-
"LEFT JOIN ras_AttTypeItem d ON b.AttTypeId=d.ItemId " & _
-
"WHERE b.DIN=c.DIN"
-
Set rsDataRAS = da_GetRs(QuerySelect)
-
-
'Mengambil data dari dbSIKawan
-
'QuerySelectSIKawan = "SELECT * FROM " _
-
& "finger_data_karyawan"
-
'Set rsSIKawan = da_GetRecord(QuerySelectSIKawan)
-
-
rsSQL.CursorLocation = adUseClient
-
-
With rsSQL.Fields
-
.Append "idNo", adInteger
-
.Append "device", adInteger
-
.Append "idFinger", adInteger
-
.Append "nikKary", adVarChar, 50
-
.Append "namaKary", adVarChar, 100
-
.Append "time", adDate
-
.Append "tipeAbsen", adVarChar, 64
-
End With
-
-
rsSQL.Open
-
-
If rsDataRAS.RecordCount > 0 Then
-
jlhField = 0
-
-
While Not rsDataRAS.EOF Or rsDataRAS.BOF
-
rsSQL.AddNew
-
rsSQL("idNo").Value = jlhField + 1
-
rsSQL("device").Value = rsDataRAS("DN").Value 'field device
-
rsSQL("idFinger").Value = rsDataRAS("DIN").Value 'field finger ID
-
rsSQL("nikKary").Value = rsDataRAS("PIN").Value 'field nik karyawan
-
rsSQL("namaKary").Value = rsDataRAS("UserName").Value 'field nama karyawan
-
rsSQL("time").Value = rsDataRAS("Clock").Value 'field waktu
-
rsSQL("tipeAbsen").Value = rsDataRAS("ItemName").Value 'field tipe waktu
-
-
'06.10.2010
-
'simpan ke dbSIKawan
-
rsSQL.Update
-
rsDataRAS.MoveNext
-
jlhField = jlhField + 1
-
-
QueryInsertSIKawan = "INSERT INTO finger_data_karyawan " _
-
& "(idNo, Device, idFinger, NIKKary, NamaKary, " _
-
& "TglHadir, TimeIn, TipeAbsen) " _
-
& "VALUES('" & rsSQL("idNo").Value & "', '" & rsSQL("device").Value & "', " _
-
& "'" & rsSQL("idFinger").Value & "', '" & rsSQL("nikKary").Value & "', " _
-
& "'" & rsSQL("namaKary").Value & "', " _
-
& "'" & Format(rsSQL("time").Value, "mm/dd/yyyy") & "', " _
-
& "'" & Format(rsSQL("time").Value, "mm/dd/yyyy h:mm:ss") & "', " _
-
& "'" & rsSQL("tipeAbsen").Value & "')"
-
-
DoEvents
-
Wend
-
-
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
0 1057 Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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)...
|
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...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
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...
| |
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,...
|
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...
|
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...
|
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,...
|
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...
|
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...
| |
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |