FM3 Changing From Topspeed to SQL(ODBC) does not copy/convert existing files


I am trying to convert my tps files to sql by changing first the file driver from topspeed to odbc driver on the dictionary, and then together with the help of fm3.

I tried testing this sample odbc app provided by fm3. (2.2 MB)

When I tried running Run time file manager, it successfully created the tables, but it has 0 records converted.

Am I missing something? Or the documentation itself says that copying only works on flat files?

I think that you shold send this directly to Bruce.
I gave up myself on FM3 when i changed to MSSQL, and have made a program called “Totalupdate” instead for each of my dct’s.

1 Like

May I know atleast a bit of info on how that works? I have created a converter where i have a function and only pass the file as parameter and manually deep assign columns of old tps file to new sql file. But that’s only usable to one dictionary that I need to convert to. Procedure Passing Two File and Record Parameters for deep assign.

I was pretty sure that File Manager also creates the conversion program that you can run to convert your data, so presumably there is a step for that somewhere?

You also seem to have your own conversion process is there a reason why you haven’t used that to convert your data?

I have to recreate again using the dictionary that I want to convert, and another cons in using my own conversion process is I need to have a tps table and odbc table, but in fm3 you only manage version and upg file

When setting it up to convert from TPS to SQL are you setting the OldName option?

How are you doing multiple dstabases? Are you using Multiproj, or something else?

Yes I have setup OldName Option.
I am not doing multiple databases and multi-proj.

I used variable in defining file names and set it before fm3 procedure assigning using SetFileName() procedure

my settings is based on odbc sample provided by fm3

The variable for filenames only has to be set before the file is opened. Its not used in the upg.

I’m not seeing the OldName option being set there?

The copy will only happen when the SQL table is created, so make sure you drop the table from the db before conversion.

Did you run the “SupportABC” utility template?

May I know where can I set the OldName Option? I only know the OldName is set on dictionary

And to assign the variable filename I follow this guide

In my SetFileName() Procedure have this code

SetFileNames         PROCEDURE
PATH:Branch = CLIP(GLO:DataSource) & '\branch.dat'  

where this is under the After PROGRAM CODE statement embed

  FuzzyMatcher.Init                                        ! Initilaize the browse 'fuzzy matcher'
  FuzzyMatcher.SetOption(MatchOption:NoCase, 1)            ! Configure case matching
  FuzzyMatcher.SetOption(MatchOption:WordOnly, 0)          ! Configure 'word only' matching
  INIMgr.Init('.\sql_convert.INI', NVD_INI)                ! Configure INIManager to use INI file
   ! Generated using Clarion Template version v11.1  Family = abc
    ds_FM_Upgrading &= ds_PassHandleForUpgrading()
    if ds_FMInited = 0
      ds_FMInited = 1
    SQL_Connect()                                  ! Generated by FM3
                ds_AlternateFileNameAndOwner('' & PATH:Branch & '','Branch',Branch,)
        if GetIni(ds_AppName(),'BadFile',,'.\fm3.ini')
          RuntimeFilemanager    ! this line placed by the FM3 "Auto Fix" option.
                       ! If you have this procedure, and you're making an abc app
                       ! and you still get an error here then check that the "declare
                       ! globally" setting is also set ON for this procedure.
              !! Don't forget to add the FM2=>1 define to your project
              You did forget didn't you ?
              ! close this window - go to the app - click on project - click on properties -
              ! click on the defines tab - add FM2=>1 to the defines...
    End  !End of if ds_FMInited = 0
  GLO:FM3Done = 1
    ds_FMKill() ! Placed by FM2/3
  INIMgr.Kill                                              ! Destroy INI manager
  FuzzyMatcher.Kill                                        ! Destroy fuzzy matcher

I have also run SupportABC utility template still no luck.

For reference, you can try this sample provided by fm3. I also haven’t been able to convert tps files to sql here via odbc using dsn connectivity. It only creates the sql tables but doesn’t copy the records (2.2 MB)