Jump to content

Recommended Posts

Posted

Boas pessoal, gostava de por estes códigos, mas a ir buscar à pasta Debug\Teste\... do Programa.

MyConnection =  New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\teste\Teste.mdb")

e

e.Graphics.DrawImage(Image.FromFile("C:\teste\" & "Imagem1.gif"), 100, 68)

Alguém me pode explicar sff? Cumprimentos.

Posted
My.Application.Info.DirectoryPath & "\teste\Teste.mdb"

Vai onde quer que o executável esteja.

Sérgio Ribeiro


"Great coders aren't born. They're compiled and released"
"Expert coders do not need a keyboard. They just throw magnets at the RAM chips"

Posted

My.Application.Info.DirectoryPath & "\teste\Teste.mdb"

Vai onde quer que o executável esteja.

Se fizer como tu disseste, ou seja:

MyConnection = New OleDbConnection(My.Application.Info.DirectoryPath & "\teste\Teste.mdb")

Dá-me erro.

Posted

Não rapaz.

MyConnection =  New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & My.Application.Info.DirectoryPath & "\teste\Teste.mdb")

Faltava-te o resto da connectionstring. Não é só o caminho para a DB.

Sérgio Ribeiro


"Great coders aren't born. They're compiled and released"
"Expert coders do not need a keyboard. They just throw magnets at the RAM chips"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.