Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No Import/Export for MSSQLExpress
Message
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01187706
Message ID:
01187785
Views:
21
>>So.......... any way to get the VFP data over to SQL Express easily, or am I sunk before I start????
>
>You can roll your own. Here' the guts of some code that I use to move data from old fox tables to SQL Server tables. I do this because I have several field names changing and so forth. I set up the OLDDATA cursor prior to this method being called. Also, the cTablename property actually holds the name of a view against the SQL table that you are moving data to. Obviously not everything is below, but it should be enough to get you going. I've used this for years.
>
>
>
>* Program....: importsqlextrlot.Import_Perform
>* Version....: 1.0
>* Author.....: ** Delton Lee, III **
>* Date.......: April 22, 04
>
>LOCAL m.DummyID, ;
>	lcTargetTable, ;
>	lnHandle
>
>	lcTargetTable = THIS.cDBCNAME + "!" + This.cTablename
>
>IF NOT USED("TARGPARENT")
>
>	lnHandle = This.oConnection.nConnectionHandle
>	USE (lcTargetTable) CONNSTRING lnHandle IN 0 ALIAS TARGPARENT
>
>ENDIF
>
>SELECT OLDDATA
>
>DO WHILE NOT EOF()
>
>	SELECT OLDDATA
>	SCATTER MEMVAR MEMO
>
>	*-- Deal with PK + any field name changes here
>	m.ExtrLotID = GUID()
>	m.cSpoolDesc = m.cSpoolCode
>	m.dCompleted = m.dCompDate
>	m.SpecMastID = m.iSpecMast
>	m.SpecDetlID = m.iSpecDetl
>	STORE m.cmatldesc TO m.cprodtype
>	STORE INT(m.nWOQTY) TO m.iWOQTY
>	IF EMPTY(m.dDueDate)
>		STORE .NULL. TO m.dDueDate
>	ENDIF
>	IF EMPTY(m.dEntered)
>		STORE .NULL. TO m.dEntered
>	ENDIF
>	IF EMPTY(m.dCompleted)
>		STORE .NULL. TO m.dCompleted
>	ENDIF
>
>	
>	INSERT INTO &lcTargetTable FROM MEMVAR
>	
>	IF NOT EMPTY(This.cChildTable)
>
>		*-- Pass primary key to Child routine
>		This.InsertChildren(m.DummyID)
>
>	ELSE
>
>		SKIP
>
>	ENDIF
>
>	This.SendFeedback("One Moment, Please...", .t., recno()/this.nSourceRecordCount)
>
>ENDDO
>
>
Thanks for the code.
Tommy Tillman A+ NetWork+ MCP
Previous
Reply
Map
View

Click here to load this message in the networking platform