Problemas con BulkCopy !!!!!

01/08/2003 - 18:08 por xavendano | Informe spam
Salu2 !!!

He realizado varias pruebas con el objeto BulkCopy pero para ejecutar
Export..coloco algo como lo siguiente, que omitiendo todas las
declaraciones y demás, queda:

With lBulk
.DataFileType = SQLDMODataFile_TabDelimitedChar
.DataFilePath = "c:\Prueba.txt"
End With

tbl.ExportData (lBulk)

Y me presenta el error: 438 - Object doesn't support this property or method

Alguna idea????
Gracias!!!!!

Preguntas similare

Leer las respuestas

#1 xavendano
01/08/2003 - 20:01 | Informe spam
Ahora me aparece el error siguiente:

[Microsoft][ODBC SQL Server Driver]Connection is not enabled for BCP

What´s is?????

Gracias..



"xavendano" escribió en el mensaje
news:
Salu2 !!!

He realizado varias pruebas con el objeto BulkCopy pero para ejecutar
Export..coloco algo como lo siguiente, que omitiendo todas las
declaraciones y demás, queda:

With lBulk
.DataFileType = SQLDMODataFile_TabDelimitedChar
.DataFilePath = "c:\Prueba.txt"
End With

tbl.ExportData (lBulk)

Y me presenta el error: 438 - Object doesn't support this property or


method

Alguna idea????
Gracias!!!!!



Respuesta Responder a este mensaje
#2 Eladio Rincón
02/08/2003 - 13:08 | Informe spam
Hola,

creo que el problema qeu tienes es que no tienes habilitada la opción para
permitir realizar operaciones de registro masivo; prueba a poner esta linea
en tu código y nos comentas:
sql.EnableBcp = True



este código me ha funcionado:


Dim sql As New SQLDMO.SQLServer

Dim db As SQLDMO.Database

Dim tbl As SQLDMO.Table

Dim bcp As New SQLDMO.BulkCopy

sql.LoginSecure = True

sql.Connect()

sql.Databases.Refresh()

sql.EnableBcp = True

Dim i As Integer

For i = 1 To sql.Databases.Count - 1

If sql.Databases.Item(i).Name = "Northwind" Then

db = sql.Databases.Item(i)

End If

Next

db.Tables.Refresh()

For i = 1 To db.Tables.Count - 1

If db.Tables.Item(i).Name = "Customers" Then

tbl = db.Tables.Item(i)

End If

Next

With bcp

.DataFileType = 2

.ErrorFilePath = "c:\errores.txt"

.DataFilePath = "c:\Customers.txt"

End With

tbl.ExportData(bcp)

End Sub


Eladio Rincón
MCP, SQL Server MVP
http://eu.webmatrixhosting.net/Eladio

"Comparte lo que sabes, aprende lo que no sepas." FGG

"xavendano" escribió en el mensaje
news:
Ahora me aparece el error siguiente:

[Microsoft][ODBC SQL Server Driver]Connection is not enabled for BCP

What´s is?????

Gracias..



"xavendano" escribió en el mensaje
news:
> Salu2 !!!
>
> He realizado varias pruebas con el objeto BulkCopy pero para ejecutar
> Export..coloco algo como lo siguiente, que omitiendo todas las
> declaraciones y demás, queda:
>
> With lBulk
> .DataFileType = SQLDMODataFile_TabDelimitedChar
> .DataFilePath = "c:\Prueba.txt"
> End With
>
> tbl.ExportData (lBulk)
>
> Y me presenta el error: 438 - Object doesn't support this property or
method
>
> Alguna idea????
> Gracias!!!!!
>
>
>


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida