Hi David

This is the magic sentence:

Server Refresh MYTABLE

But this is ony nessessary fi you are using the linked table. If you have connected to 
the database using "Live" the changes have been sent to the database when you save the 
table.

Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk/gis

Har du husket MapInfo Konferencen d. 8 og 9. september 2004.
Tilmelding samt yderligere information kan ses p�: http://www.cowi.dk/GIS


-----Original Message-----
From: David Baker [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 03, 2004 5:37 PM
To: [EMAIL PROTECTED]
Subject: RE: MI-L Open Access tables in MI but still allow editing in Access?


On 23 Aug 2004 at 12:19, Peter Horsb�ll M�ller <[EMAIL PROTECTED]> wrote:

> If you open the Access table using ODBC instead of DAO you will be 
> able to edit the table from both MapInfo and Access at the same time. 
> ODBC even gives you some troubleshooting for handling conflicts, when 
> a record has been altered from both MapInfo and Access.

Thanks Peter - this turned out to be a great answer as I can now have an Access 
database open in Access & MapInfo at the same time, and any modifications to the 
table using the Jet engine in VB or by using Access itself work fine.

It's been a bit of a learning curve, having never done this sort of thing before, and 
I'm 
now firmly stuck at the next hurdle! :-)

I want to change one of the fields in a record using MapBasic - basically I want to 
change my ship name. I do my normal Update Table command & I don't get any error 
message, but the field contents don't change! I figure I need to do something 
completely different, but I can't figure out what. 

I thought about using a Server Commit, but that requires a ConnectionNumber which I 
don't have as I used a "Server Link Table  SQLQuery  Using ConnectionString" which 
doesn't give a ConnectionNumber.

Here is my code:

' Open the Access database table
' CorrectDriverName found previously using Server_DriverInfo... CorrectDriverName = 
"DSN=" & CorrectDriverName & ";DBQ=C:\Program Files\MVMMap\Data\Vessels.mdb" Server 
Link Table "Select * from Vessels" Using CorrectDriverName Into "Vessels" File 
"C:\Program Files\MVMMap\Data\Vessels.TAB"

'Print out all the info first so I know where I am. 
'TempName is the new vessel name to be changed
Print "MVMMap.ChangeName: Before: Vessels.RowID = " & Vessels.RowID Print 
"MVMMap.ChangeName: Before: TempName = " & TempName 
Print "MVMMap.ChangeName: Before: Vessels.Name = " & Vessels.Name 
CurrentRow = Vessels.RowID

' Try updating the table with the new name info
Update Vessels Set Name = TempName where RowID = currentRow Print "MVMMap.ChangeName: 
After1: Vessels.RowID = " & Vessels.RowID Print "MVMMap.ChangeName: After1: TempName = 
" & TempName 
Print "MVMMap.ChangeName: After1: Vessels.Name = " & Vessels.Name 
' Unfortunately Vessels.Name still <> TempName after this Update.

' Lets try commiting the table to see if that works.
'Commit Table Vessels Automatic ApplyUpdates    ' there are a few choices here! This 
one doesn't save changes made!
'Commit Table Vessels Automatic DiscardUpdates  ' there are a few choices here! Also 
doesn't appear to work!
'Commit Table Vessels Automatic NoCollision     ' there are a few choices here! Also 
doesn't appear to work!
Commit Table Vessels Interactive                                ' there are a few 
choices here! Damn - doesn't work either!
Fetch First from Vessels
Fetch Rec CurrentRow from Vessels
Print "MVMMap.ChangeName: After2: Vessels.RowID = " & Vessels.RowID Print 
"MVMMap.ChangeName: After2: TempName = " & TempName 
Print "MVMMap.ChangeName: After2: Vessels.Name = " & Vessels.Name 
' After trying all 4 methods above I still don't have the change 
' written into my Vessels.mdb database! Vessels.Name still <> TempName either.


So, anyone know what I am doing wrong? Or am I totally confused & can't do what I am 
trying to do anyway? :-)

Thanks,

Dave

        

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, 
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13205



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13218

Reply via email to