You are not logged in.

1

Monday, February 22nd 2010, 5:23pm

Can't Connect to MDB database

Hi there,

Can somebody help me with this code, I cannot get it to work!
:huh:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Public Sub cmdConnect_Click()

   Dim res As ResultSet
   
   Database1.ConnectMDB("C:\Clients.mdb")
   
   Dim Rows As Integer = 0
   
   JBGrid1.Cols = 3   
   
   JBGrid1.Header(0) = "Name"
   JBGrid1.Header(1) = "Address"
   JBGrid1.Header(2) = "City"
   
   res = Database1.ExecuteStatement("SELECT * FROM Clients")
   
   Do While res.next
 	JBGrid1.TextMatrix(res.getRow() - 1, 0) = res.getString("cName")
 	JBGrid1.TextMatrix(res.getRow() - 1, 1) = res.getString("cAddress")
 	JBGrid1.TextMatrix(res.getRow() - 1, 2) = res.getString("cCity")
 	Rows = Rows + 1
 	JBGrid1.Rows = Rows
   Loop
  
   res.close

End Sub


Always getting some errors...

Best regards,
Viktor
I think it will be a good replacement for VB6 after a little improvements and minor bug fixes... :rolleyes:

This post has been edited 1 times, last edit by "beic" (Feb 22nd 2010, 8:09pm)


2

Monday, February 22nd 2010, 8:06pm

Working like a charm, I forgot to put Database Component on to Form! :whistling:

I am a little bit confused with this language mixing VB6/JAVA, sorry again! 8o

Best regards,
Viktor
I think it will be a good replacement for VB6 after a little improvements and minor bug fixes... :rolleyes:

This post has been edited 1 times, last edit by "beic" (Feb 22nd 2010, 8:14pm)


Rate this thread
WoltLab Burning Board