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
Reply

Join Date: Aug 2006
Posts: 2
Reputation: fbdubai is an unknown quantity at this point 
Solved Threads: 0
fbdubai fbdubai is offline Offline
Newbie Poster

Beginners help to migrate from Access to MS SQL fomr VB

 
0
  #1
Aug 9th, 2006
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2383 | Replies: 0
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC