DBF to SQL script tool

Re: DBF to SQL script tool

Postby nageswaragunupudi » Tue Aug 05, 2014 12:41 pm

We can and we should create different databases on the server for different projects/purposes. On some servers like MSSql, they are referred to as Catalogs. Purpose is the same. You can consider them as folders on our disk.

You can either create them with the help of tools provided at the time of installation or through program:
oCn:Execute( "CREATE DATABASE FWH" ) // here FWH is the database we are creating.

Then while connecting you can directly connect to FWH as default database/catalog.
That is what is the cInitCat is meant for.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10642
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: DBF to SQL script tool

Postby Horizon » Wed Aug 06, 2014 8:08 am

Hi Mr. Rao,

I understand. but how can I find out FWH is created or not created. After than I can create database

I also use MySql.

Thanks.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: DBF to SQL script tool

Postby Marc Vanzegbroeck » Wed Aug 06, 2014 8:55 am

Hi,

You can use
Code: Select all  Expand view
oCn:Execute( "CREATE DATABASE IF NOT EXISTS FWH" )


Then it will be only created when it doesn't exist.
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: DBF to SQL script tool

Postby Horizon » Wed Aug 06, 2014 9:14 am

Marc Vanzegbroeck wrote:Hi,

You can use
Code: Select all  Expand view
oCn:Execute( "CREATE DATABASE IF NOT EXISTS FWH" )


Then it will be only created when it doesn't exist.


Thank you Marc. I will try it soon.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: DBF to SQL script tool

Postby avista » Wed Aug 06, 2014 8:15 pm

I understand. but how can I find out FWH is created or not created. After than I can create database


Why not something like this

Code: Select all  Expand view

TRY
 oCn:Execute( "CREATE DATABASE FWH" )
 CATCH
 MsgInfo("Error while creating database FWH")
END TRY
 
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: DBF to SQL script tool

Postby cnavarro » Wed Aug 06, 2014 8:22 pm

Horizon wrote:Hi Mr. Rao,

I understand. but how can I find out FWH is created or not created. After than I can create database

I also use MySql.

Thanks.


Use the FW_AdoTableExists ( cTable, oCn ) function to see if the table was created (ADOFUNCS,PRG)
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests