Click here to Skip to main content
15,868,016 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionDiamond Looping Pin
Framework .l.7-Feb-12 14:51
Framework .l.7-Feb-12 14:51 
AnswerRe: Diamond Looping Pin
Johan Hakkesteegt7-Feb-12 21:18
Johan Hakkesteegt7-Feb-12 21:18 
AnswerRe: Diamond Looping Pin
Simon_Whale8-Feb-12 0:46
Simon_Whale8-Feb-12 0:46 
AnswerRe: Diamond Looping Pin
hansoctantan9-Feb-12 3:55
professionalhansoctantan9-Feb-12 3:55 
GeneralRe: Diamond Looping Pin
Framework .l.9-Feb-12 14:14
Framework .l.9-Feb-12 14:14 
Questionaccess uniquetable Pin
C#Coudou6-Feb-12 18:31
C#Coudou6-Feb-12 18:31 
AnswerRe: access uniquetable Pin
Abhinav S6-Feb-12 19:12
Abhinav S6-Feb-12 19:12 
GeneralRe: access uniquetable Pin
C#Coudou6-Feb-12 20:40
C#Coudou6-Feb-12 20:40 
thanks. i check the db2 and it has the same table.

is my approach correct?
i mean connecting other database in an access form.

here is my snippet code: ACCESS FORM
VB
'Default database DB1
Private Sub Form_Open(Cancel As Integer)
   Dim ssql As String
 
    ssql = "SELECT [tbl1].id, [tbl1].code,[tbl1].mflag, [tbl2].cdnum, [tbl3].bname"
    ssql = ssql & " FROM  [tbl1] INNER JOIN"
    ssql = ssql & " [tbl2] ON"
    ssql = ssql & " [tbl1].id = [tbl2].id INNER JOIN"
    ssql = ssql & " [tbl3] ON [tbl1].code = [tbl3].code"
    ssql = ssql & " WHERE [tbl1].mdate ='2011/10/12'"
    Me.RecordSource = ssql
    
    Me.UniqueTable = "tbl2"

End Sub

'option to select DB1 or DB2
Private Sub optSel_AfterUpdate()
    Dim ssql As String
    
    'DB1
    If Me.optSel = 1 Then
        ssql = "SELECT [tbl1].id, [tbl1].code,[tbl1].mflag, [tbl2].cdnum, [tbl3].bname"
        ssql = ssql & " FROM  [tbl1] INNER JOIN"
        ssql = ssql & " [tbl2] ON"
        ssql = ssql & " [tbl1].id = [tbl2].id INNER JOIN"
        ssql = ssql & " [tbl3] ON [tbl1].code = [tbl3].code"
        ssql = ssql & " WHERE [tbl1].mdate ='2011/10/12'"      
    Else 'DB2
        ADODisconn 'disconnect to DB1
     
        ADOConDB2  'connect to DB2        
        
         ssql = "SELECT [tbl2].id,[tbl2].code,[tbl2].mflag,[tbl2].cdnum,[tbl3].bname"
         ssql = ssql & " FROM  [tbl2] INNER JOIN [tbl3] ON "
         ssql = ssql & " [tbl2].code = [tbl3].code"
         ssql = ssql & " WHERE [tbl2].id > 160" 
    End If

   Me.RecordSource = ssql
   Me.UniqueTable = "tbl2"

End Sub

C# コードMicrosoft End User
2000-2008




「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」


GeneralRe: access uniquetable Pin
Abhinav S6-Feb-12 21:34
Abhinav S6-Feb-12 21:34 
GeneralRe: access uniquetable Pin
C#Coudou6-Feb-12 22:07
C#Coudou6-Feb-12 22:07 
GeneralRe: access uniquetable Pin
Eddy Vluggen7-Feb-12 7:41
professionalEddy Vluggen7-Feb-12 7:41 
GeneralRe: access uniquetable Pin
C#Coudou7-Feb-12 13:41
C#Coudou7-Feb-12 13:41 
GeneralRe: access uniquetable Pin
Eddy Vluggen8-Feb-12 0:18
professionalEddy Vluggen8-Feb-12 0:18 
Questionupdate table programitaclly Pin
Member 32752635-Feb-12 20:40
Member 32752635-Feb-12 20:40 
AnswerRe: update table programitaclly Pin
Mycroft Holmes5-Feb-12 22:14
professionalMycroft Holmes5-Feb-12 22:14 
QuestionGraphic in DataGridView problem Pin
Mangore755-Feb-12 14:10
Mangore755-Feb-12 14:10 
AnswerRe: Graphic in DataGridView problem Pin
Richard MacCutchan5-Feb-12 23:29
mveRichard MacCutchan5-Feb-12 23:29 
GeneralRe: Graphic in DataGridView problem Pin
Mangore756-Feb-12 6:24
Mangore756-Feb-12 6:24 
GeneralRe: Graphic in DataGridView problem Pin
Richard MacCutchan6-Feb-12 6:33
mveRichard MacCutchan6-Feb-12 6:33 
GeneralRe: Graphic in DataGridView problem Pin
Mangore756-Feb-12 8:26
Mangore756-Feb-12 8:26 
GeneralRe: Graphic in DataGridView problem Pin
Richard MacCutchan6-Feb-12 9:30
mveRichard MacCutchan6-Feb-12 9:30 
AnswerRe: Graphic in DataGridView problem Pin
Luc Pattyn6-Feb-12 0:23
sitebuilderLuc Pattyn6-Feb-12 0:23 
GeneralRe: Graphic in DataGridView problem Pin
Mangore756-Feb-12 6:22
Mangore756-Feb-12 6:22 
AnswerRe: Graphic in DataGridView problem Pin
Luc Pattyn6-Feb-12 6:33
sitebuilderLuc Pattyn6-Feb-12 6:33 
QuestionGetting a table Pin
Dalek Dave5-Feb-12 8:50
professionalDalek Dave5-Feb-12 8:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.