Senin, 01 Agustus 2016

RE: [belajar-access] Query Union Error ketika tabel terkoneksi ke MySql

 

Mas Hariyanto, cara yang mas kasih sudah sy copa terapkan tapi saya menemui error sbb:

 

Sebagai informasi tambahan BE-nya ada LAN dengan IP 10.12.0.2, apakah betul jika baris berikut sy ganti sbb:

Function KONEKSI()
'connToDB txtServer, txtUID, txtPWD, 3306, txtDb
connToDB "localhost", "root", "admin", 3306, "Nama_database"
End Function

Menjadi :

Function KONEKSI()
'connToDB txtServer, txtUID, txtPWD, 3306, txtDb
connToDB "10.12.0.2", "root", "admin", 3306, "Production"
End Function

 

Best Regards

CW

 

From: belajar-access@yahoogroups.com [mailto:belajar-access@yahoogroups.com]
Sent: 01 Agustus 2016 12:02
To: belajar-access@yahoogroups.com
Subject: RE: [belajar-access] Query Union Error ketika tabel terkoneksi ke MySql

 

 

Begini...,

1. Buat modul koneksi dan nama komputer, karena akan di pakai di hampir semua form. Nama komputer digunakan untuk nama tabel biar unik antar masing-masing user

Ini scriptnya:

Option Explicit
Public conn As New ADODB.Connection 'deklarasi koneksi

Private Const MAX_COMPUTERNAME As Long = 15
Private Declare Function GetComputerName Lib "kernel32" _
Alias "GetComputerNameA" _
(ByVal lpBuffer As String, _
nSize As Long) As Long

Private Function TrimNull(item As String)

'return string before the terminating null
Dim pos As Integer

pos = InStr(item, Chr$(0))

If pos Then
TrimNull = Left$(item, pos - 1)
Else
TrimNull = item
End If

End Function

Function KOM()
'untuk membuat tabel berdasarkan nama komputer

Dim tas As String

'pre-load the text boxes with
'the local computer name for testing
tas = Space$(MAX_COMPUTERNAME + 1)
Call GetComputerName(tas, Len(tas))

KOM = TrimNull(tas)
If KOM Like "*-*" Then
KOM = Replace(KOM, "-", "_")
End If
End Function

Public Function connToDB(ServerName As String, _
UserName As String, userPass As Variant, _
dbPath As String, dbName As String)

Dim strCon As String

On Error GoTo errHandle
'sesuaikan driver mysqlnya, ada yang pakai 3.51
strCon = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=" _
& ServerName & ";DATABASE=" & dbName & ";" & _
"UID=" & UserName & ";PWD=" & userPass & ";OPTION=16426"

Set conn = New ADODB.Connection
conn.Open strCon

Exit Function

errHandle:
MsgBox "SERVER SEDANG TIDAK AKTIF", , "NON AKTIF"
conn.Close
Set conn = Nothing
End Function

Public Function EscapeQuotes(s) As String

If s = "" Then
EscapeQuotes = ""
ElseIf Left(s, 1) = "'" Then
EscapeQuotes = "''" & EscapeQuotes(Mid(s, 2))
Else

EscapeQuotes = Left(s, 1) & EscapeQuotes(Mid(s, 2))
End If

End Function

Function hp_tb(n_tb)
Dim rbs As Recordset
Dim db As DAO.Database
'untuk menghapus tabel Access temporer
Set rbs = CurrentDb.OpenRecordset("SELECT MSysObjects.Name" _
& " FROM MSysObjects WHERE MSysObjects.Type= 1 And MSysObjects.Flags=0" _
& " and MSysObjects.Name='" & n_tb & "'") 'melihat nama tabel n_tb
If Not rbs.EOF Then 'bila ada record
Set db = CurrentDb 'menetapkan bahwa db adalah database ini
db.TableDefs.Delete n_tb 'hapus tabel
'menghilangkan dari memory komputer
db.Close
Set db = Nothing
End If
'menghilangkan dari memory komputer
rbs.Close
Set rbs = Nothing

End Function

Function KONEKSI()
'connToDB txtServer, txtUID, txtPWD, 3306, txtDb
connToDB "localhost", "root", "admin", 3306, "Nama_database"
End Function

2. Kita mulai bermain di form. Misal nama comboBoxnya contoh.Propertinya:
Control Source ==> kosongkan
Row Source Type ==> Table/query
Row Source ==> kosongkan
Coloum Count ==> 1
Coloum Head ==> No

3. Misal, event yang kita manfaatkan adalah saat, pertama kali loading.

Private Sub Form_Load()
Dim tb as Variant
Dim db As Database
Dim rsp As ADODB.Recordset 'deklarasi rsp sebagai ADODB recordset

KONEKSI 'melakukan koneksi
If conn.State <> 0 Then 'bila sudah konek
contoh.RowSource = "" 'menghilangkan recordsource dulu biar tidak error
contoh.Visible = False 'tidak ditampilkan dulu
tb = "temp_" & KOM 'nama tabel temporer yang akan kita buat
hp_tb (tb) 'hapus tabel temporer dulu bila sudah ada
'buat tabel temporer asumsi nama field=field1
'size 255
DoCmd.RunSQL "CREATE TABLE " _
& tb & " (field1 Text(255));"
'melihat data di tabel mysql
Set rsp = conn.Execute("SELECT left([Week_Subc],5)" _
& " From TblCultureProduction UNION" _
& " SELECT left([Week_Subc],5) From" _
& " TblCultureIncoming")
If Not rsp.EOF Then
DoCmd.Hourglass True
Set db = CurrentDb 'deklarasi db adalah currentdb
'mengisi record dengan --All--
db.Execute ("Insert into " _
& tb & " Values ('--All---')")
Do While Not rsp.EOF 'jika ada data, lakukan berulang sampai akhir
If rsp.Fields(0) <> "" Then 'jika record berisi
'isi tabel temporer dengan data Mysql
db.Execute ("Insert into " _
& tb & " Values ('" _
& EscapeQuotes(rsp.Fields(0)) _
& "')")
End If
rsp.MoveNext
Loop
db.Close
Set db = Nothing
DoCmd.Hourglass False
End If
rsp.Close
Set rsp = Nothing
contoh.RowSource = tb 'letakkan recordsource combo contoh
contoh.DefaultValue = """--All--""" 'menjadikan --All-- sebagai devault value
contoh.Visible = Trye 'Tampilkan
contoh.Requery 'refresh
Else
MsgBox "gagal koneksi"
End If
conn.Close 'menutup koneksi
Set conn = Nothing 'menghilangkan koneksi dari memori

End Sub

Semoga bisa membantu dan memberi semangat.

Hariyanto (Surabaya)

__._,_.___

Posted by: "Cecep" <cepwahyu@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (10)

Save time and get your email on the go with the Yahoo Mail app
Get the beautifully designed, lighting fast, and easy-to-use Yahoo Mail today. Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

SPAM IS PROHIBITED

.

__,_._,___

Re: [MS_AccessPros] Replace field if another exists.

 

John,

I found that I had set the default value of person_ID in tblCitation to 0. I removed that and now its working correctly. 

With Warm Regards,
 
Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265  Ext. 130
Fax (605)964-1070

"Anyone who claimed that old age had brought them patience was either lying or senile."  







From: "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Sunday, July 31, 2016 4:08 PM
Subject: Re: [MS_AccessPros] Replace field if another exists.

 
Yes.  0 is not the same as Null.  You need:

IIf(IsNull([PersonID]) Or ([PersonID] = 0), ...

John

Sent from my iPhone

On Jul 31, 2016, at 5:39 PM, Art Lorenzini dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I guess I was not quite done. When I run the query it pulls in the person name from the tbl_persons table, but if there is no personId (PersonID = 0), then it should be pulling the name from the tbl_Citation but for some reason it is not seeing even though there is an entry there.

SELECT tbl_citations.CitationID, tbl_citations.FirstName, tbl_citations.MiddleName, tbl_citations.LastName, tbl_citations.IsLicensed, tbl_citations.Person_ID, tbl_citations.Fee, tbl_citations.ViolationCodeID, tbl_citations.WardenID, tbl_citations.CourtDateTime, tbl_citations.ReasonForViolation, tbl_citations.Priority, tbl_citations.OpenDate, tbl_citations.Close, tbl_citations.Comments, tbl_citations.Created_By, tbl_citations.Created_On, tbl_citations.Edited_By, tbl_citations.Edited_On, IIf(IsNull([Person_ID]),[FirstName] & " " & [LastName],DLookUp("cPersonName","qryAdd_People","Person_ID = " & [Person_ID])) AS PersonName, tbl_lkpViolationCode.Code, DLookUp("WardenName","qryLookup_WardenName","WardenID = " & [WardenID]) AS WardenName
FROM tbl_citations LEFT JOIN tbl_lkpViolationCode ON tbl_citations.ViolationCodeID = tbl_lkpViolationCode.ViolationCodeID;

Is it the case that PersonID contains a 0 and is not truly NUll? 

With Warm Regards,
 
Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265  Ext. 130
Fax (605)964-1070

"Anyone who claimed that old age had brought them patience was either lying or senile."  







From: "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Friday, July 29, 2016 2:54 PM
Subject: Re: [MS_AccessPros] Replace field if another exists.

 
Art-

Sorry, I didn't notice the extra ( in your original syntax.  Try:

IIf(IsNull(PersonID]), [FirstName] & " " & [LastName], DLookup("LastName", "tbl_Persons", "PersonID = " & [PersonID]))

John Viescas, author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Access Applications

On Jul 29, 2016, at 15:00, Art Lorenzini dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

THis is what I have got so far:

SELECT tbl_citations.CitationID, tbl_citations.FirstName, tbl_citations.MiddleName, tbl_citations.LastName, tbl_citations.IsLicensed, tbl_citations.Person_ID, tbl_citations.Fee, tbl_citations.ViolationCodeID, tbl_citations.OfficerID, tbl_citations.CourtDateTime, tbl_citations.ReasonForViolation, tbl_citations.Priority, tbl_citations.OpenDate, tbl_citations.Close, tbl_citations.Comments, tbl_citations.Created_By, tbl_citations.Created_On, tbl_citations.Edited_By, tbl_citations.Edited_On, [FirstName] & " " & [LastName] AS FullName, IIf(IsNull((PersonID]), [FirstName] & " " & [LastName], DLookup("LastName", "tbl_Persons", "PersonID = " & [PersonID]))
FROM tbl_citations;

I am receiving a syntax error in the following line:

IIf(IsNull((PersonID]), [FirstName] & " " & [LastName], DLookup("LastName", "tbl_Persons", "PersonID = " & [PersonID]))
FROM tbl_citations;
 

With Warm Regards,
 
Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265  Ext. 130
Fax (605)964-1070

"Anyone who claimed that old age had brought them patience was either lying or senile."  







From: "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Friday, July 29, 2016 12:39 PM
Subject: Re: [MS_AccessPros] Replace field if another exists.

 
Art-

If this expression is in the underlying query, then don't refer to the form control.  Do this:

IIf(IsNull((PersonID]), [FirstName] & " " & [LastName], DLookup("PersonName", "tblPerson", "PersonID = " & [PersonID]))

John Viescas, author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Access Applications

On Jul 29, 2016, at 14:15, Art Lorenzini dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

OK. I knew I was missing something. THis query will be used on a continuous form where the combobox does not exist.

IIf(IsNull((PersonID]), [FirstName] & " " & [LastName], DLookup("PersonName", "tblPerson", "PersonID = " & [Forms]![Myform]![cmbPersonID]))
 
Something like this maybe.

Here is the structure of the tblCitation that this query is derived from:

SELECT tbl_citations.CitationID, tbl_citations.FirstName, tbl_citations.MiddleName, tbl_citations.LastName, tbl_citations.IsLicensed, tbl_citations.Person_ID, tbl_citations.Fee, tbl_citations.ViolationCodeID, tbl_citations.OfficerID, tbl_citations.CourtDateTime, tbl_citations.ReasonForViolation, tbl_citations.Priority, tbl_citations.OpenDate, tbl_citations.Close, tbl_citations.Comments, tbl_citations.Created_By, tbl_citations.Created_On, tbl_citations.Edited_By, tbl_citations.Edited_On
FROM tbl_citations;

With Warm Regards,
 
Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265  Ext. 130
Fax (605)964-1070

"Anyone who claimed that old age had brought them patience was either lying or senile."  







From: "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Thursday, July 28, 2016 6:52 PM
Subject: Re: [MS_AccessPros] Replace field if another exists.

 
Art-

Yup.  But it sounds like you need something like:

IIf(IsNull([Forms]![Myform]![cmbPersonID]), [FirstName] & " " & [LastName], DLookup("PersonName", "OtherTable", "PersonID = " & [Forms]![Myform]![cmbPersonID]))

John Viescas, author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Access Applications

On Jul 28, 2016, at 18:23, Art Lorenzini dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Here is example of what you are talking about I have in another application:

SELECT [Learning Center Non Client Activities].NonClientActivityID, [Learning Center Non Client Activities].LearningCenterID, [Learning Center Non Client Activities].ActivityDate, IIf(IsNull([ProgramName]),[LastName] & ", " & [FirstName],[ProgramName]) AS [Non-ClientName], [Learning Center Non Client Activities].Note, [Lookup Learning Center Client Activity Type].ClientActivityDetailName, [Learning Center Non Client Activities].ActivityTypeID
FROM [Learning Center Non Client Activities] INNER JOIN [Lookup Learning Center Client Activity Type] ON [Learning Center Non Client Activities].ActivityTypeID=[Lookup Learning Center Client Activity Type].ClientActivityDetailID;

 IIf(IsNull([ProgramName]),[LastName] & ", " & [FirstName],[ProgramName]) AS [Non-ClientName

But in my new case, Instead of ProgramName I have PersonID, BUt I need to use the DLOOKUP to pull the person name out of tblPerson based on the PersonID selected.

With Warm Regards,
 
Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265  Ext. 130
Fax (605)964-1070

"Anyone who claimed that old age had brought them patience was either lying or senile."  







From: "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Thursday, July 28, 2016 2:26 PM
Subject: Re: [MS_AccessPros] Replace field if another exists.

 
Art-

Sounds like you need an IIf function that tests the selection in the combo box and returns either the concatenated name or a DLookup to the other table.  Without more info, I can't give you specific code.

John Viescas, author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Access Applications

On Jul 28, 2016, at 16:11, dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I have a query in which I need to display either the concatenated fullname or a name based on a ID in another table.

Select [FirstName] & " " & [LastName] as FullName, (or associated name from tblPerson if PersonID is selected, CitationID, Code, CitiationDate
FROM tblCitation

I would need to pull the [FirstName] & " " & [LastName] from tblPerson If the user selects a PersonID from the dropdown.

Clear as mud  know

Thank you,
Art Lorenzini
Sioux Falls, SD










__._,_.___

Posted by: Art Lorenzini <dbalorenzini@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (12)

Save time and get your email on the go with the Yahoo Mail app
Get the beautifully designed, lighting fast, and easy-to-use Yahoo Mail today. Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

[belajar-access] File - Tata Tertib dan Aturan.txt

 


Tata tertib dan peraturan
Mailing List: belajar-access@yahoogroups.com

1. Mailing list ini membahas mengenai pemrograman Microsoft Access.
2. Tidak diperkenankan mem-posting topik yang tidak ada kaitannya sama sekali dengan pemrograman MS Access, peluang kerja atau tawaran kerja sama dengan keahlian di bidang MS Access, atau pengajaran/kursus MS Acces. Pelanggaran terhadap aturan ini akan di-ban dari keanggotaan milis ini.
3. Mohon berdiskusi dengan baik, dengan semangat membangun, demi kemajuan kita bersama. Hindarilah perbantahan (flame) yang bisa menjadi pertengkaran yang tidak perlu.
4 Hindari reply permintaan one-liner seperti 'saya minta juga dong', 'saya setuju', dan lain-lain yang tidak perlu.
5. Sedapat mungkin memberikan data-data yang lengkap dalam mengajukan suatu masalah untuk memudahkan rekan-rekan sesama member mengidentifikasi dan mencarikan solusi, termasuk memberikan subject yang sesuai dengan isi email, tidak dengan kata-kata seperti "tologing dong", "pusing...", "ada yang bisa bantu..", dll.

Moderator

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (113)

Save time and get your email on the go with the Yahoo Mail app
Get the beautifully designed, lighting fast, and easy-to-use Yahoo Mail today. Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

SPAM IS PROHIBITED

.

__,_._,___

RE: [belajar-access] Query Union Error ketika tabel terkoneksi ke MySql

 

Terimakasih banyak mas Hariyanto,

Akan saya pelajari dan fahami dulu, kepala saya dah mulai sedikit ngebul nih liat scriptnya...hehehe

Maklum kebiasaan maen wizard

 

Best Regards

CW

 

From: belajar-access@yahoogroups.com [mailto:belajar-access@yahoogroups.com]
Sent: 01 Agustus 2016 12:02
To: belajar-access@yahoogroups.com
Subject: RE: [belajar-access] Query Union Error ketika tabel terkoneksi ke MySql

 

 

Begini...,

1. Buat modul koneksi dan nama komputer, karena akan di pakai di hampir semua form. Nama komputer digunakan untuk nama tabel biar unik antar masing-masing user

Ini scriptnya:

Option Explicit
Public conn As New ADODB.Connection 'deklarasi koneksi

Private Const MAX_COMPUTERNAME As Long = 15
Private Declare Function GetComputerName Lib "kernel32" _
Alias "GetComputerNameA" _
(ByVal lpBuffer As String, _
nSize As Long) As Long

Private Function TrimNull(item As String)

'return string before the terminating null
Dim pos As Integer

pos = InStr(item, Chr$(0))

If pos Then
TrimNull = Left$(item, pos - 1)
Else
TrimNull = item
End If

End Function

Function KOM()
'untuk membuat tabel berdasarkan nama komputer

Dim tas As String

'pre-load the text boxes with
'the local computer name for testing
tas = Space$(MAX_COMPUTERNAME + 1)
Call GetComputerName(tas, Len(tas))

KOM = TrimNull(tas)
If KOM Like "*-*" Then
KOM = Replace(KOM, "-", "_")
End If
End Function

Public Function connToDB(ServerName As String, _
UserName As String, userPass As Variant, _
dbPath As String, dbName As String)

Dim strCon As String

On Error GoTo errHandle
'sesuaikan driver mysqlnya, ada yang pakai 3.51
strCon = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=" _
& ServerName & ";DATABASE=" & dbName & ";" & _
"UID=" & UserName & ";PWD=" & userPass & ";OPTION=16426"

Set conn = New ADODB.Connection
conn.Open strCon

Exit Function

errHandle:
MsgBox "SERVER SEDANG TIDAK AKTIF", , "NON AKTIF"
conn.Close
Set conn = Nothing
End Function

Public Function EscapeQuotes(s) As String

If s = "" Then
EscapeQuotes = ""
ElseIf Left(s, 1) = "'" Then
EscapeQuotes = "''" & EscapeQuotes(Mid(s, 2))
Else

EscapeQuotes = Left(s, 1) & EscapeQuotes(Mid(s, 2))
End If

End Function

Function hp_tb(n_tb)
Dim rbs As Recordset
Dim db As DAO.Database
'untuk menghapus tabel Access temporer
Set rbs = CurrentDb.OpenRecordset("SELECT MSysObjects.Name" _
& " FROM MSysObjects WHERE MSysObjects.Type= 1 And MSysObjects.Flags=0" _
& " and MSysObjects.Name='" & n_tb & "'") 'melihat nama tabel n_tb
If Not rbs.EOF Then 'bila ada record
Set db = CurrentDb 'menetapkan bahwa db adalah database ini
db.TableDefs.Delete n_tb 'hapus tabel
'menghilangkan dari memory komputer
db.Close
Set db = Nothing
End If
'menghilangkan dari memory komputer
rbs.Close
Set rbs = Nothing

End Function

Function KONEKSI()
'connToDB txtServer, txtUID, txtPWD, 3306, txtDb
connToDB "localhost", "root", "admin", 3306, "Nama_database"
End Function

2. Kita mulai bermain di form. Misal nama comboBoxnya contoh.Propertinya:
Control Source ==> kosongkan
Row Source Type ==> Table/query
Row Source ==> kosongkan
Coloum Count ==> 1
Coloum Head ==> No

3. Misal, event yang kita manfaatkan adalah saat, pertama kali loading.

Private Sub Form_Load()
Dim tb as Variant
Dim db As Database
Dim rsp As ADODB.Recordset 'deklarasi rsp sebagai ADODB recordset

KONEKSI 'melakukan koneksi
If conn.State <> 0 Then 'bila sudah konek
contoh.RowSource = "" 'menghilangkan recordsource dulu biar tidak error
contoh.Visible = False 'tidak ditampilkan dulu
tb = "temp_" & KOM 'nama tabel temporer yang akan kita buat
hp_tb (tb) 'hapus tabel temporer dulu bila sudah ada
'buat tabel temporer asumsi nama field=field1
'size 255
DoCmd.RunSQL "CREATE TABLE " _
& tb & " (field1 Text(255));"
'melihat data di tabel mysql
Set rsp = conn.Execute("SELECT left([Week_Subc],5)" _
& " From TblCultureProduction UNION" _
& " SELECT left([Week_Subc],5) From" _
& " TblCultureIncoming")
If Not rsp.EOF Then
DoCmd.Hourglass True
Set db = CurrentDb 'deklarasi db adalah currentdb
'mengisi record dengan --All--
db.Execute ("Insert into " _
& tb & " Values ('--All---')")
Do While Not rsp.EOF 'jika ada data, lakukan berulang sampai akhir
If rsp.Fields(0) <> "" Then 'jika record berisi
'isi tabel temporer dengan data Mysql
db.Execute ("Insert into " _
& tb & " Values ('" _
& EscapeQuotes(rsp.Fields(0)) _
& "')")
End If
rsp.MoveNext
Loop
db.Close
Set db = Nothing
DoCmd.Hourglass False
End If
rsp.Close
Set rsp = Nothing
contoh.RowSource = tb 'letakkan recordsource combo contoh
contoh.DefaultValue = """--All--""" 'menjadikan --All-- sebagai devault value
contoh.Visible = Trye 'Tampilkan
contoh.Requery 'refresh
Else
MsgBox "gagal koneksi"
End If
conn.Close 'menutup koneksi
Set conn = Nothing 'menghilangkan koneksi dari memori

End Sub

Semoga bisa membantu dan memberi semangat.

Hariyanto (Surabaya)

__._,_.___

Posted by: "Cecep" <cepwahyu@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (9)

Save time and get your email on the go with the Yahoo Mail app
Get the beautifully designed, lighting fast, and easy-to-use Yahoo Mail today. Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

SPAM IS PROHIBITED

.

__,_._,___

[AccessDevelopers] File - Monthly_Notices.txt

 


Monthly notices:

Hi Kids!:

Don't forget to check out our "Links" section at the website for helpful sites. Also take a peek at books that others have found worthwhile in our books database under the 'Database' link of the main AccessDevelopers page. Feel free to add any books or links that you have found useful.

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (145)

Save time and get your email on the go with the Yahoo Mail app
Get the beautifully designed, lighting fast, and easy-to-use Yahoo Mail today. Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


Please zip all files prior to uploading to Files section.

.

__,_._,___