| | |
Beginners help to migrate from Access to MS SQL fomr VB
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2006
Posts: 2
Reputation:
Solved Threads: 0
I am trying to migrate my MS Access database to MS SQL.
My coding pattern is simple. Like this
'---------------------
Data1.Database.Close
Data1.DatabaseName = App.Path & "\Status.mdb"
Data1.RecordSource = "Performance"
Data1.Refresh
C1 = "SlNo = 1"
Data1.Recordset.FindFirst C1
If Data1.Recordset.NoMatch = False Then
Data1.Recordset.Edit
Data1.Recordset.Fields("Amount") = Format(mamt, "##,##0.00")
Data1.Recordset.Fields("Upd") = Now
Data1.Recordset.Update
Else
MsgBox "Error in Updating the File !!!", vbExclamation
End If
Data1.Database.Close
'----------
How is it possible to get it to work if I move over to MS SQL
Data1.Connect = "FILEDSN=ABC.dsn;UID=sa;PWD=test111"
Data1.DatabaseName = "Status"
Data1.RecordSource = ("Select Name, Amount from Performance")
Data1.Refresh
Data1.Recordset.MoveFirst
Do While Data1.Recordset.EOF = False
MsgBox Data1.Recordset.Fields("Name") & " , " & _
& Data1.Recordset.Fields("Amount")
Data1.Recordset.MoveNext
Loop
This works (TO test Reading from MS SQL)
BUT How can I update the File ????????????
Eg. Add a Text "TEST" to the beginning of the field Name in the above File.
PLEASE HELP. I know it is simple for you but am stuck with this.
Thanks in advance
FB
My coding pattern is simple. Like this
'---------------------
Data1.Database.Close
Data1.DatabaseName = App.Path & "\Status.mdb"
Data1.RecordSource = "Performance"
Data1.Refresh
C1 = "SlNo = 1"
Data1.Recordset.FindFirst C1
If Data1.Recordset.NoMatch = False Then
Data1.Recordset.Edit
Data1.Recordset.Fields("Amount") = Format(mamt, "##,##0.00")
Data1.Recordset.Fields("Upd") = Now
Data1.Recordset.Update
Else
MsgBox "Error in Updating the File !!!", vbExclamation
End If
Data1.Database.Close
'----------
How is it possible to get it to work if I move over to MS SQL
Data1.Connect = "FILEDSN=ABC.dsn;UID=sa;PWD=test111"
Data1.DatabaseName = "Status"
Data1.RecordSource = ("Select Name, Amount from Performance")
Data1.Refresh
Data1.Recordset.MoveFirst
Do While Data1.Recordset.EOF = False
MsgBox Data1.Recordset.Fields("Name") & " , " & _
& Data1.Recordset.Fields("Amount")
Data1.Recordset.MoveNext
Loop
This works (TO test Reading from MS SQL)
BUT How can I update the File ????????????
Eg. Add a Text "TEST" to the beginning of the field Name in the above File.
PLEASE HELP. I know it is simple for you but am stuck with this.
Thanks in advance
FB
![]() |
Similar Threads
- Visual C#: Inserting an Access Database Record (C#)
- MS Access v/s MS SQL Server 2000 (MySQL)
- QUICK! Access SQL using ASP and javascript (ASP)
- MS Access Beginner (MS SQL)
- request for ansi sql queries equalent to MS access (Visual Basic 4 / 5 / 6)
- Access Web Database? (Database Design)
- Importing SQL Script File - Urgent !! (Database Design)
- ASP and SQL ? (MS SQL)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Would visual basic be able to do this?
- Next Thread: Automation in Excel
Views: 2383 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 2007 access activex add age append application basic beginner birth bmp c++ calculator cd click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





