Exception Assistant


Visual Studio Debugger
Troubleshooting Exceptions: System.Data.OleDb.OleDbException

An OleDbException exception is generated when a warning or error is returned by an OLE DB data source.

Associated Tips

Verify that you are connecting with valid credentials.

Make sure that the credentials you are supplying are valid. For more information, see OleDbErrorCollection.

Verify that the server name is correct and that the server is running.

Make sure that you are using the correct server name, and that the server can be reached. For more information, see OleDbErrorCollection.

Remarks

This exception is thrown whenever the .NET Framework Data Provider for OLE DB encounters an error generated by the server.

If the severity of the error is too great, the server may close the OleDbConnection. However, the user can reopen the connection and continue.

See Also

Tasks

Reference



Community Content

Umbelino Maia
erro de sintaxe

#Region

"Pesquisar"

PrivateSub Cmb_Pesquisar_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cmb_Pesquisar.SelectedIndexChanged

Dim constring AsString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Projetos VB\banco_combo_2\banco_combo_2\cadastro.mdb;Persist Security Info=False"

'criar objeto para comunicao com o banco'

Dim dbcon AsNew OleDb.OleDbConnection(constring)

'criar data reader'

Dim rs2 As OleDbDataReader

'abre o banco de dados'

dbcon.Open()

'comando que ser executado o banco aberto'

Dim strsql AsString = "select nome, sexo, casado, anonascimento, preferencia from funcionrio where codigo = " & Cmb_Pesquisar.SelectedValue

'montar o comando para submeter ao banco

Dim cm AsNew OleDb.OleDbCommand(strsql, dbcon)

cm.CommandType = CommandType.Text

'executar o comando e armazenar os registros

rs2 = cm.ExecuteReader

'lendo os dados na memoria principal"

rs2.Read()

'atribuir valores para os campos que foram achados"

Txt_nome.Text = rs2(

"nome")

Txt_Sexo.Text = rs2(

"sexo")

Txt_anonasc.Text = rs2(

"ano nascimento")

Rdb_nao.Checked = rs2(

"nao")

Rdb_sim.Checked = rs2(

"sim")

CheckBoxrevista.Checked = rs2(

"revista")

CheckBoxtv.Checked = rs2(

"tv")

'fechar comexo com datareader'

rs2.Close()

'fechar conexo com o banco"

dbcon.Close()

EndSub

#End

Region
Tags :

tuey
Conexion con archivo de texto - Unspecified error

OleDbConnection con_txt = newOleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Application.StartupPath + "\\; Extended Properties='text; HDR=No; FMT=Fixed'");

con_txt.Open();

OleDbCommand com_txt = newOleDbCommand("select * from Cedulas.txt",con_txt);

OleDbDataReader dr_txt = com_txt.ExecuteReader(); <--------------------------------------*AQUI SE PRODUCE EL ERROR*


ERROR:
****************************************************************************************************
No se controló System.Data.OleDb.OleDbException
Message="Unspecified error"
Source="Microsoft JET Database Engine"
ErrorCode=-2147467259
StackTrace:
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OleDb.OleDbCommand.ExecuteReader()
at WindowsApplication1.Form1..ctor() in D:\Mis Documentos\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\Form1.cs:line 29
at WindowsApplication1.Program.Main() in D:\Mis Documentos\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Tags :

Page view tracker