944,156 Members | Top Members by Rank

Ad:
Aug 9th, 2006
0

Beginners help to migrate from Access to MS SQL fomr VB

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
fbdubai is offline Offline
2 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Would visual basic be able to do this?
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Read data from RS232





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC