|
-
September 5th, 2001, 04:37 PM
#1
ERROR: NOT RESPONDING
HI..
ITS ME AGAIN..
IM WORKING WITH BCP, SQLDMO AND VB6.0 WITH SQL SERVER 7.0
WHEN I RUN MY APPLICATION, IN MY TASK MANAGER SAYS "NOT RESPONDING" , (IM TRYING TO IMPORT TXT INTO A TEMPORAL TABLE )
BUT, THE THING.. IS .. WHEN I OPEN MY QUERY ANALYZER AND MAKE A QUERY.. THIS SEEMS TO WORK... LET ME TRY TO EXPLAIN.. .. MY QUERY RETURN ALL THE ROWS THAT I WAS IMPORTED... DO U KNOW WHAT I MEAN.. BUT MY APPLICATION IS NOT WORKING ANYMORE
ANYBODY KNOW WHAT COULD BE????? ITS URGENT!!
THIS IS MY CODE:
private Sub cmdiniciar_Click()
'Instanciamos los objetos
set objBCP = new SQLDMO.BulkCopy
set objServer = new SQLDMO.SQLServer
set objDB = new SQLDMO.Database
on error GoTo ErrorHandler
With objServer
.EnableBcp = true
.LoginSecure = true
.Connect ServerName, UserName, Password
End With
set objDB = objServer.Databases(DatabaseName)
With objBCP
.SetCodePage SQLDMOBCP_OEM
.UseBulkCopyOption = true
.ColumnDelimiter = "|"
.DataFileType = SQLDMODataFile_SpecialDelimitedChar
.DataFilePath = FArchivo.Path & selectedFile
.ErrorFilePath = "c:\errores.log"
.ImportRowsPerBatch = 100
'.MaximumErrorsBeforeAbort = 5000
.RowDelimiter = vbCrLf 'Carriage return
.ServerBCPDataFileType = SQLDMOBCPDataFile_Native
.ServerBCPKeepNulls = true
.SuspendIndexing = false
.UseExistingConnection = true
End With
If optexporta.Value = false then
objDB.Tables(Tablename).ExportData objBCP
Debug.print "nCount " & ncount
objServer.Disconnect
set objServer = nothing
else
objDB.Tables(Tablename).ImportData objBCP (THIS is WHERE MY APPLICATION DID NOT WORK..WHEN I CALL THE IMPORT DATA, BUT THE INFORMATION WAS IMPORTED INTO THE TABLE!!!)
objServer.Disconnect
objServer.Close
set objServer = nothing
End If
cn.Close ' cerramos la conexion
set cn = nothing 'liberamos la conexion
End
ErrorHandler:
Call MsgBox("Descripción :" & Err.Description, vbCritical + vbOKOnly, "error ")
set objBCP = nothing
set objServer = nothing
set objDB = nothing
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|