Jump to content

VB6 - Prob Agenda


vaurdan
 Share

Recommended Posts

Oi tou com um prob neste code:

Option Explicit

Global DBenc As Database

Global etiqueta As String

Global tblpes As Recordset

Global tblami As Recordset

Sub abrirBD()

Set DBenc = OpenDatabase("c:\projectos\tutoriais\amigos.mdb")

Set tblpes = DBenc.OpenRecordset("pessoal")

Set tblami = DBenc.OpenRecordset("amigos")

End Sub

Sub fecharBD()

tblpes.Close

tblami.Close

DBenc.Close

End Sub

os a bold é o ke dá probs

aparece: ' Compile Error: User-Defined type not defined'

Tou a fazer uma agenda i isto é um Module.

Obrigado

http://www.neopt.org <- O meu blog xD
Link to comment
Share on other sites

Porque não usas o ADODC ?? É só adicionares o componente Microsoft ADO Data Control e depois fazes:

Private Sub DB()

Dim strPath As String
strPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=CAMINHO_DA_BASE_DE_DADOS;Persist Security Info=False"
Adodc1.ConnectionString = strPath

End Sub

Private Sub Command1_Click()
Adodc1.RecordSource = "Select count(*) from login"
Adodc1.Refresh

Se quiseres optar por este método e tiveres alguma duvida avisa que tento esclarecer-te ...tens outras maneiras mas esta parece-me ser a mais simples

Link to comment
Share on other sites

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
 Share

×
×
  • 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.