If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Help solving how to use SQL-DMO in Delph

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-01-03, 02:33
Matrixcd Matrixcd is offline
Registered User
 
Join Date: Sep 2003
Location: TEXAS
Posts: 1
Unhappy Help solving how to use SQL-DMO in Delph

I would appreaciate anyone help to assist me in solve how to use the bcp within Delphi. Source is very much appreaciated also.

//SQL_DMO := CreateOLEObject('SQLDMO.SQLServer');
{DmTblViewer.SQL_DMO := coSQLServer.Create;
DmTblViewer.SQL_DMO.LoginSecure := True;
DmTblViewer.SQL_DMO.LoginTimeOut := 30;
DmTblViewer.SQL_DMO.AutoReconnect := True;
DmTblViewer.SQL_DMO.ApplicationName := 'SQL Script Builder';
//SQL_DMO.Connect('PTRAK2000',);
//SQL_DMO.Connect('servername','username','password) ;
DmTblViewer.SQL_DMO.Connect('MYSERVER','','');
If not DmTblViewer.SQL_DMO.VerifyConnection(SQLDMOConn_Re connectIfDead) then
begin
raise Exception.Create
('An error has occurrend while attempting to' + #10#13 +
'conect to the SQL OLE Server.' + #10#13 +
'Be sure to load the SQL Server 7.x tools' + #10#13 +
'before attempting to use SQL Script Builder.' + #10#13 +
'(msg:dmSQL.pas/SetSQLObjectDatabase)');
end;}
SQLDMODataFile_UseFormatFile;
{ DmTblViewer.SQL_DMO.EnableBcp := True;
DmTblViewer.SQL_BCP.ColumnDelimiter := '|';
DmTblViewer.SQL_BCP.DataFilePath := 'D:\export\gopher.dat';
DmTblViewer.SQL_BCP.ErrorFilePath := 'D:\export\gopher.err';
DmTblViewer.SQL_BCP.ImportRowsPerBatch := 500;
DmTblViewer.SQL_BCP.MaximumErrorsBeforeAbort := 1;
DmTblViewer.SQL_BCP.RowDelimiter := #10#13;
DmTblViewer.SQL_BCP.ServerBCPDataFileType := SQLDMOBCPDataFile_Char;
DmTblViewer.SQL_BCP.UseExistingConnection := True;
//DmTblViewer.SQL_DMO.Databases := 'Northwind';
nRows := DmTblViewer.DbTables.ExportData(DmTblViewer.SQL_BC P);}
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On