Dive into deep insights and technical expertise 😎

Saturday, December 16, 2023

Green Tea benefits driven mainly by ‘Polyphenols’ | Green Tea Reviews

Green Tea benefits

Green Tea deep dive


Green Tea Side effects


Green tea has lot of health benefits, however it's side effects should also be considered, if we think about every human health. Before discussing benefits of green tea, let us consider the side effect part.

Green tea may slow down the effectiveness of some medication due to potential interaction with caffeine content. This may introduce inadvertent delay in patient’s recuperation from disease related to heart, kidney, liver, stomach ulcers, anxiety, high blood pressure, bipolar disorder, depression, anemia, osteoporosis, and glaucoma.

During some medications, green tea may increase effectiveness of medicines (for e.g. antibiotics) and introduce the risk of side effects when taken along with prescribed medicines. In such situations, green tea may cause unknown adverse effects (like mania, increase in blood pressure, internal bleeding, agitation, insomnia, stomach pain and cramps etc) on patients.


In addition to this, pregnant and breastfeeding women should avoid drinking green tea.

Please note that overdose of Caffeine (including caffeine from green tea) can cause headaches, loss of appetite, dizziness, nausea, vomiting and diarrhea.

Hence to be on safer side, it is always recommended to consult your doctor or health care provider before consuming green tea if you are on some medications. Now we have some information on side effects, let us check why green tea is beneficial for human health.

Green tea health benefits



Green tea provides most of the health benefits due to its enormous antioxidant effects and help to deal with some serious health problems. The antioxidant properties in green tea are mainly due to chemicals called ‘Polyphenols’. Though ‘Polyphenol’ content give bitter taste to green tea, but it makes the green tea a greater medicinal drink. Our nervous system play critical role in controlling and managing the human body. Green tea helps to stimulate and keep our nervous system peaceful. The reason behind this is mainly due to amino acid compound content present in green tea.

Overweight and obesity can be caused due to several reasons. Apart from taking medicines and special therapies, we should also ensure to take a good sound sleep and drink enough water daily. If we don’t have time to sleep, then our body too doesn’t respond to medication properly. Secondly drinking enough water daily resolves some of our common health issues.  In addition to this, if green tea is taken regularly, it may help to enhance metabolism and burn unnecessary fat. Gradually green tea effect can help in improving the weight loss and controlling obesity issues.


People with borderline diabetes can be benefitted by taking green tea extract daily. It may help to regulate glucose in the body and control blood sugar levels. Green tea considerably helps in reducing harmful LDL cholesterol and increasing good HDL cholesterol thereby lowering total cholesterol. Regular dosage of green tea can block harmful cholesterol from being absorbed in the intestine. As a result, it will help the body to manage and get rid of high cholesterol problem.

Struggling with cancer is a grave situation. People are more likely to have successful treatment of cancer, if it is diagnosed in early stage on time. Drinking green tea regularly may reduce the risk of different types of cancer (related to gall bladder, ovary, breast, lung, esophagus, pancreas, prostate, skin, stomach, and colon). Polyphenols content in green tea may help to kill cancerous cells and prevent them from growing.


So next time if you like to consume green tea benefits, happily accept the bitter taste of ‘Polyphenol‘ and enjoy this great medicinal drink!



Share:

Thursday, December 14, 2023

Uncovering Wealth Secrets in 'Rich Dad Poor Dad' book by Robert Kiyosaki


Rich Dad Poor Dad book summary


In the world of personal finance and investment literature, few books have made as profound an impact as Robert Kiyosaki's "Rich Dad Poor Dad". One of the most compelling sections in this book is "The Tale of Two Dads". Here, we'll delve into this intriguing narrative, shedding light on its profound insights and teachings.

Unraveling the Tale of Two Dads


"The Tale of Two Dads" is more than just a story—it's an exploration of contrasting perspectives on money, wealth, and education. Robert Kiyosaki introduces us to two influential figures from his childhood: his biological father (Poor Dad) and his friend's father (Rich Dad). These two men, despite their shared roles as fathers, couldn't be more different in their beliefs and actions regarding finance.

Poor Dad, a highly educated man with a secure job, believed in the traditional path of studying hard, getting a good job, and saving for retirement. He saw the world through a lens of scarcity, often saying, "I can't afford it". His approach to money was rooted in fear and caution, which, while providing a stable life, didn't lead to wealth creation.

In stark contrast, Rich Dad, a business owner with an 8th-grade education, viewed money as a tool for wealth generation. He believed in financial education, investing, and entrepreneurship. Instead of saying, "I can't afford it", he would ask, "How can I afford it?" This shift in mindset, from scarcity to abundance, is one of the key lessons Kiyosaki emphasizes.

The crux of "The Tale of Two Dads" lies in the different paths these men took and the resulting financial outcomes. Poor Dad, despite his steady job and high education, struggled financially. Rich Dad, on the other hand, grew his wealth exponentially through smart investments and business ventures.

Kiyosaki uses this tale to challenge conventional wisdom about money. He argues that a good education and a stable job are not enough to achieve financial independence. Instead, financial literacy—understanding the difference between an asset and a liability, knowing how to make money work for you— is the key to wealth creation.

"The Tale of Two Dads" is a call to action for readers to reassess their financial beliefs and habits. Kiyosaki urges us to step out of our comfort zones, to seek financial education, and to embrace the mindset of abundance over scarcity.

The Rich Don't Work for Money: A Deep Dive into 'Rich Dad Poor Dad'


Every so often, a book comes along that shakes up the status quo and changes our perspective on life. 'Rich Dad Poor Dad' by Robert Kiyosaki is one such book. Among its many insights, one stands out: "The Rich Don't Work for Money". 

In the opening chapters of 'Rich Dad Poor Dad', Kiyosaki introduces us to the idea that the rich don't work for money. It's a statement that may seem counterintuitive at first. After all, isn't the pursuit of money the very reason why people work? But Kiyosaki invites us to look deeper and understand the mindset of the wealthy.

The rich, according to Kiyosaki, work to learn, not to earn. They understand that financial education and intelligence are more valuable than a paycheck. They focus on acquiring assets - things that put money into their pockets, such as investments, real estate, and businesses. In contrast, the middle class and the poor often find themselves stuck in the 'rat race', working for money but never quite getting ahead.

The 'rat race' is a cycle that keeps people trapped in their jobs. They work to earn money, to pay bills, and to afford their lifestyle. But as their income increases, so do their expenses. This is what Kiyosaki refers to as the 'earn-spend cycle'. Breaking free from this cycle requires a shift in mindset - from working for money to having money work for you.

Kiyosaki emphasizes the importance of financial education. Understanding money - how to make it, manage it, multiply it - is what sets the rich apart. They invest time and resources in learning about finances, understanding markets, exploring investment opportunities, and managing risks. This knowledge, coupled with the courage to act, is what helps them build wealth.

Instead of working for money, the rich make money work for them. They invest in assets that generate income - stocks, bonds, real estate, and businesses. These assets, over time, grow and generate passive income. This is the key to financial freedom, according to Kiyosaki.

Contrasting Mindsets: A Deep Dive into 'Rich Dad Poor Dad'


In the iconic book "Rich Dad Poor Dad", author Robert Kiyosaki introduces us to the world of financial education through the lens of two paternal figures. One of the most compelling sections of the book, "Contrasting Mindsets", brings to light the different attitudes towards money and wealth that shape our lives. Let's navigate this financial journey together.

Kiyosaki's narrative is split between his biological father, the 'Poor Dad', an educated man with a stable job but perpetual financial struggles, and his friend's father, the 'Rich Dad', a business savant with an elementary school education but an empire of wealth. These two figures embody the contrasting mindsets that Kiyosaki wants us to understand.

The 'Poor Dad' mindset is one that many of us may find familiar. It's the belief that the path to success is through traditional education and a secure job. This mindset values hard work, stability, and the comfort of a regular paycheck. However, Kiyosaki points out that this approach often leads to a cycle of working to earn and earning to pay bills, with little left for wealth accumulation.

On the other hand, the 'Rich Dad' mindset advocates for financial independence through investment and entrepreneurship. Instead of trading time for money, this mindset encourages the creation of money-generating assets. It's about using money as a tool to make more money, rather than seeing it as a means to an end.

Kiyosaki isn't suggesting that one mindset is superior to the other. Rather, he illustrates how these different perspectives can impact our financial future. The 'Poor Dad' mindset often leads to financial vulnerability, while the 'Rich Dad' mindset opens up opportunities for wealth creation.

However, adopting the 'Rich Dad' mindset requires a shift in thinking that's not always easy. It requires financial literacy, risk-taking, and a willingness to step out of the comfort zone. It's about understanding the power of passive income, the importance of investing, and the potential of entrepreneurship.

The "Contrasting Mindsets" section is not just about the difference between being rich and poor. It's a call to action to educate ourselves about money, to challenge our beliefs about wealth, and to take control of our financial future. It's about the freedom that comes with financial independence and the choices that it allows us to make.

Understanding the Power of Assets in 'Rich Dad, Poor Dad'


In the world of finance, assets hold a significant power, a concept brilliantly encapsulated by Robert Kiyosaki in his best-selling book "Rich Dad, Poor Dad."

Kiyosaki's definition of assets extends beyond the conventional understanding. He sees assets not just as tangible properties or possessions but as anything that puts money in your pocket. This includes investments like stocks, bonds, mutual funds, real estate, and even intellectual property.

Kiyosaki's Rich Dad emphasizes the importance of acquiring assets and limiting liabilities. He suggests that the rich invest their money into income-generating assets, while the poor spend their money on liabilities, often mistaking them for assets.

A key takeaway from this section is the distinction between assets and liabilities. Kiyosaki's Rich Dad defines an asset as something that brings in money (income), and a liability as something that takes away money (expenses). The rich dad's formula for wealth is simple: acquire assets and avoid liabilities.

This distinction is crucial because it changes the way we perceive wealth. Wealth isn't about how much money you earn—it's about how much you keep. And the best way to keep money is by investing in assets.

Consider a real estate investment. If you purchase a property and rent it out, the rental income you receive is an asset. On the other hand, if you buy a luxury car that requires high maintenance, it becomes a liability draining your resources.
Kiyosaki also mentions intellectual properties like books, patents, or music royalties as assets. For instance, every time a copy of "Rich Dad, Poor Dad" is sold, Kiyosaki earns a royalty—an asset that keeps money flowing into his pocket.

Kiyosaki's "The Power of Assets" provides an insightful perspective on wealth creation. The key is to understand the difference between assets and liabilities, focusing on accumulating the former. It's not about how much money you make but how much you keep and grow. This mindset shift is a stepping stone towards financial independence, a journey that starts with understanding the true power of assets.

A Deep Dive into 'Financial Education' from 'Rich Dad Poor Dad'

Welcome to a journey towards financial empowerment! Today, we're exploring the pivotal section on 'Financial Education' from Robert Kiyosaki's groundbreaking book, 'Rich Dad Poor Dad'. This transformative work has changed the way millions approach their finances, and the 'Financial Education' section is a cornerstone of its wisdom.

In 'Rich Dad Poor Dad', Kiyosaki emphasizes the stark difference between simply earning money and understanding money. His argument is rooted in the idea that, without financial education, one is prone to making ineffective decisions that can lead to a cycle of financial insecurity and missed opportunities.

Kiyosaki's 'Rich Dad' understood the power of financial education. He believed in the principle of money working for you, not the other way around. This fundamental shift in mindset, from a labor-for-income to an asset-building perspective, is a game-changer. It's not just about accumulating wealth, but about making your wealth work for you.

The 'Financial Education' section outlines practical steps towards financial literacy. For instance, understanding the difference between assets and liabilities, recognizing the value of investing, and learning how to leverage debt. By mastering these concepts, one can navigate the financial world with confidence and foresight.

'Rich Dad Poor Dad' isn't just a book, it's a financial revolution. The 'Financial Education' section offers a roadmap to financial independence and success, emphasizing the importance of financial literacy. It's a call to action for anyone seeking to take control of their financial destiny.

Remember, the journey of financial freedom begins with a single step - and that step is education. So, let's take that step together, embracing the power of financial literacy and unlocking the potential of our financial futures.

Embrace the Adventure: Overcoming Fear and Taking Risks in 'Rich Dad Poor Dad'

In the hustle and bustle of life, we often find ourselves standing at the crossroads of decision-making. And when those decisions involve financial risks, the journey becomes even more daunting. Robert Kiyosaki's groundbreaking book, "Rich Dad Poor Dad," takes us on a journey to explore this very concept, focusing specifically on the section "Overcoming Fear and Taking Risks."

Fear and risk are two sides of the same coin. They are inherent parts of our lives, especially when it comes to financial matters. Kiyosaki emphasizes the importance of understanding and managing these emotions, rather than letting them control our financial destiny. His philosophy is not about eliminating fear and risk, but learning to evaluate and navigate them wisely.

Kiyosaki imparts an important lesson - fear can be a guiding force. He suggests that instead of running away from our financial fears, we should use them as motivation to gain more knowledge and make informed decisions. The fear of losing money, for instance, should drive us to understand investments better, rather than avoiding investing altogether.

The concept of taking risks, as explained in "Rich Dad Poor Dad," is not about reckless gambling, but calculated bravery. Kiyosaki stresses the importance of financial education to understand the difference between a bad risk and a good one. He encourages readers to step out of their comfort zones and seize opportunities, guided by knowledge and understanding, rather than blind optimism.

"Rich Dad Poor Dad" provides a fresh perspective on overcoming fear and taking risks. Kiyosaki's teachings encourage us to embrace fear, learn from it, and use it as a stepping stone towards financial success. After all, life is an adventure, and every adventure requires a bit of bravery.

Remember, as Kiyosaki says, "In the real world, the smartest people are people who make mistakes and learn. In school, the smartest people don't make mistakes." So, let's learn, let's grow, and let's overcome our fears to take the leap towards financial freedom.

Embracing the Lessons of 'Rich Dad Poor Dad': A New Year's Resolution for Financial Freedom

As we bid farewell to this year and welcome the next, it's the perfect time to reflect on our financial journey and set our goals for the future. One of the most influential books that continue to shape our understanding of wealth and financial success is Robert Kiyosaki's "Rich Dad Poor Dad." The profound lessons from this book could be the cornerstone of our New Year's resolution for achieving financial freedom.

The central theme of 'Rich Dad Poor Dad' revolves around the importance of financial education, investing in assets, and the courage to take calculated risks. Kiyosaki emphasizes that it's not about how much money you make, but how much money you keep.

In the upcoming year, let's commit to enhancing our financial literacy. Kiyosaki stresses that understanding the difference between assets and liabilities, and making money work for us instead of working for money, can be the game-changer in our financial journey.

The book encourages us to create and grow our asset column. As we step into the new year, let's focus on investing in income-generating assets such as real estate, stocks, or starting a side business, instead of accumulating liabilities.

Fear and doubt can often hold us back from taking the leap towards financial independence. Kiyosaki's book inspires us to overcome these fears, take calculated risks, and learn from our failures.

Conclusion and New Year's Resolution

As we conclude, the timeless wisdom in 'Rich Dad Poor Dad' could be our guiding light in the upcoming year. Let's make a resolution to apply these lessons, increase our financial IQ, invest in assets, and embrace risks for a prosperous financial future. Remember, it's never too late to start on the path to financial freedom.

In the spirit of 'Rich Dad Poor Dad', let's welcome the New Year with a commitment to transform our financial destiny. Here's to a year of learning, investing, and taking bold steps towards our financial goals!


Share:

Get "ServiceNow Certified System Administrator" exam certified confidently

Get CSA certified

ServiceNow Certified System Administrator (CSA) certification

Candidates passing "ServiceNow Certified System Administrator" exam shows that they have the knowledge of ServiceNow System Administration. It certifies that the person has the required skills/knowledge to:

* To manage the configuration of the ServiceNow instance

*  To manage the implementation of the ServiceNow instance

*  To manage the maintenance of the ServiceNow instance

As basic certification, it creates a solid base and help the candidate to pursue further certification related to implementation specialist, certified developer etc.

ServiceNow CSA certification pre-requisite

As a pre-requisite, candidate can go for either a three‑day ServiceNow Fundamentals training course or the on‑demand ServiceNow Fundamentals training course offered in Now Learning.

ServiceNow recommends that candidates should have attended the ServiceNow Fundamentals class and have at least six months of hands‑on experience with ServiceNow. This will help the candidate to be successful on this exam.

Additionally, some of knowledge if candidate have on database, system management, IT Help Desk processes, ITIL key processes like incident, problem, and change workflows will be an advantage and helpful.

ServiceNow CSA syllabus & preparation

Please download the exam blueprint and review what will be covered. This will give an overall idea about exam syllabus and assist in preparing this exam.

For exam registration and scheduling, please visit WebAssessor to register and sign up for the exam. Please note that appointments may be made in advance or on the actual test day, subject to availability.

Note: Candidate should be aware that ServiceNow Certification exams are computer‑based, multiple‑choice exams delivered by ServiceNow testing partner Kryterion, in a proctored environment. Online proctoring is also available.

In case candidate like to attend the exam from home in a proctored environment, should know that standalone webcam is must which should not be integrated to computer/laptop. Candidates who would like to review the requirements, please visit the WebAssessor download page.

You can go for videos playlist on sample questions of ServiceNow Certified System Administrator exam which can build your confidence level to great extent.



Share:

The book review: “How to earn $10,000 while learning to code”



The book “How to earn $10,000 while learning to code” (By Rob Percival, Cambridge, UK) is designed as a companion to The Complete Web Developer Course, but you can use any method of learning to code you like.

The book contains over 20 ‘challenges’. As per Rob, some of these ‘challenges’ will directly help you make you money. And others will just move you in the right direction to earn. Each ‘challenge’ is clearly explained, and the author recommends trying out all the ‘challenges’ before you move on to the next section. He further adds that you will earn money from day 1, but your ‘hourly rate’ might be devastatingly low.

One of the early ‘challenges’ mentioned in the book is to get your website live. For that you need to decide a domain name and purchase it. You can do this on Rob’s website, Eco Web Hosting (£6.99+VAT per year for a .com domain) if you like, or any one of many domain name providers. If you don’t buy the domain name with Eco Web Hosting, you can link it to your free web hosting by putting in a support request to your domain provider asking for the ‘nameservers’ to be changed to ns1.ecowebhosting.co.uk and ns2.ecowebhosting.co.uk. This will link the domain to servers of Eco Web Hosting and allow you to run your website and email through them.


I liked the line “The beauty of learning to code is not just that you can learn very cheaply, but that you can start making money almost immediately, if you know the tricks of the trade.” The book provides some interesting branding ideas, good tips and advice to earn a decent amount of cash.


The book mentions some very good examples of freelancing websites which can help you to earn decent money. Rob correctly mentions that getting web development work in the early stages is tough. But primarily, you’re here to learn how to do freelance web development, and build up your online portfolio and positive reviews.

Few interesting examples of freelancing sites:

The book further explains more good tips (in detail) for freelancer like:

  • Use your real identity
  • Be honest
  • Link to your Twitter feed
  • Complete the exams
  • Keep your bid low
  • Explain why your bid is low

For new freelancers, the author recommends fiverr.com mainly for practicing your skills and earning a little cash (and getting some good reviews to post on your website or Twitter feed). I think this is a smart advice to find a lot of quick online jobs. Simultaneously he recommends having an experience of Wordpress, Bootstrap, and PHP/MySQL. This will help you to start earning real money as a web developer.

The author correctly mentions that in recent years a number of gorgeous and hugely flexible themes have sprung up, which can be customized as required to make a website which is clean, professional and looks great. He adds that most likely freelance websites want the following:
  • A clean, professional, custom design
  • 5-10 pages of content, including an ‘about us’ page and a contact form
  • Possibly a blog, portfolio or shop
  • The ability to update the website themselves

The book provides some very good examples of themes sites:

The book also provides information regarding marketplaces (to sell your scripts) like http://codecanyon.com, http://phpmarket.com and several other sites. There are many more earning potential ideas and tips given in this book. Overall, I believe, if those suggestions are tried diligently, you can experience the noticeable change towards earning money online.

So all the best and have a great successful life!

Share:

Wednesday, December 13, 2023

Excel VBA: Steps to create Windows ODBC DSN to access FileMaker Pro data

Create Windows ODBC DSN to access FileMaker Pro


Accessing data from FileMaker into Excel


FileMaker database file can be accessed via ODBC/JDBC method, once following points are taken care:

  • User has proper access via ODBC/JDBC
  • Data sharing for FileMaker database file has been enabled through FileMaker Server Advanced (via FileMaker Server Admin Console) or FileMaker Pro host application
  • FileMaker database file to be accessed by ODBC/JDBC is properly hosted and available

Next step involves creation of Windows ODBC DSN for FileMaker database file. We can use below code to create the FileMaker ODBC DSN at runtime and access FileMaker Pro data through VBA code into Excel. This VBA code can be implemented to pull data from FileMaker Pro database file to any of Microsoft Office products for e.g. Excel.

Option Explicit

Private Declare Function SQLDataSources Lib "odbc32.dll" (ByVal hEnv As Long, ByVal fDirection As Integer, ByVal szDSN As String, ByVal cbDSNMax As Integer, pcbDSN As Integer, ByVal szDescription As String, ByVal cbDescriptionMax As Integer, pcbDescription As Integer) As Long

Private Declare Function SQLAllocHandle Lib "odbc32.dll" (ByVal HandleType As Integer, ByVal InputHandle As Long, OutputHandlePtr As Long) As Long

Private Declare Function SQLSetEnvAttr Lib "odbc32.dll" (ByVal EnvironmentHandle As Long, ByVal dwAttribute As Long, ByVal ValuePtr As Long, ByVal StringLen As Long) As Long

Private Declare Function SQLFreeHandle Lib "odbc32.dll" (ByVal HandleType As Integer, ByVal Handle As Long) As Long


Public Declare Function RegSetValueEx Lib "advapi32.dll" Alias _
   "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, _
   ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal _
   cbData As Long) As Long

Public Declare Function RegCreateKey Lib "advapi32.dll" Alias _
   "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, _
   phkResult As Long) As Long
 
Public Declare Function RegCloseKey Lib "advapi32.dll" _
   (ByVal hKey As Long) As Long

Private Declare Function RegOpenKey Lib "advapi32.dll" Alias _
    "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long

Private Declare Function RegDeleteKey Lib "advapi32.dll" Alias _
    "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long

Public Const FMP_DATADIRECT_DRIVER_NAME As String = "DataDirect 32-BIT SequeLink 5.4"
Public Const FMP_ODBC_DRIVER_NAME As String = "FileMaker ODBC"

Public Const FMP_DATADIRECT_DRIVER_DLL As String = "C:\Program Files\DataDirect\slodbc54\ivslk19.dll"


Public Const REG_SZ = 1    'Constant for a string variable type.
Public Const HKEY_CURRENT_USER As Long = &H80000001
Public Const HKEY_LOCAL_MACHINE As Long = &H80000002
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_CONFIG = &H80000005
Public Const HKEY_DYN_DATA = &H80000006
Public Const HKEY_PERFORMANCE_DATA = &H80000004
Public Const HKEY_USERS = &H80000003
Private Const DSN_LEN As Long = 32
Private Const DESC_LENGTH As Long = 128
Private Const FoundOk As Long = 0
Private Const GetNext As Long = 1
Private Const Null_HANDLE As Long = 0
Private Const HANDLE_ENV As Long = 1
Private Const ATTR_ODBC_VERSION As Long = 200
Private Const OV_ODBC3 As Long = 3
Private Const IS_INTEGER As Long = (-6)
Public Const FMP_ODBC_JDBC_PORT As String = "2399"

Public Const SERVERNAME As String = "Specify here FMP Server host name"


'Create an FMP ODBC DSN for any FMP database file at runtime
Public Sub Create_User_DSN(DataSourceName As String, Description As String, ServerDataSource As String, DriverName As String)
  
    'DataSourceName --> Name of DSN
    'Description --> DSN description in brief. Can be kept same as DSN Name
    'ServerDataSource --> FMP database file name for which DSN need to be created
  
    Dim DistinguishedName As String
    Dim lResult As Long
    Dim hKeyHandle As Long
 
    Dim AutoDetectEncoding As String
    Dim Database  As String
    Dim Driver  As String
    Dim MultiByteEncoding  As String
    Dim Port  As String
    Dim QueryLog_On  As String
    Dim QueryLogFile  As String
    Dim QueryLogTime  As String
    Dim Server As String
    Dim Host As String
    Dim UseLDAP As String
    Dim sMsg As String
 
    If DSNExists(DataSourceName) Then
        If Delete_User_DSN(DataSourceName) = False Then Exit Sub
    End If
  
    If UCase(DriverName) = UCase(FMP_ODBC_DRIVER_NAME) Then

        'Setting for FileMaker ODBC driver for FMP Server 11. Similarly can be done for version 12.
        'FileMaker ODBC Driver (32-bit)
      
        AutoDetectEncoding = "No"
        Database = ServerDataSource
        Driver = DriverName
        MultiByteEncoding = "UTF-8"
        Port = ""
        QueryLog_On = ""
        QueryLogFile = ""
        QueryLogTime = ""
        Server = SERVERNAME
      
      
        lResult = RegCreateKey(HKEY_CURRENT_USER, "SOFTWARE\ODBC\ODBC.INI\" & _
             DataSourceName, hKeyHandle)
           
        'Set the values of the new DSN key.
      
        lResult = RegSetValueEx(hKeyHandle, "AutoDetectEncoding", 0&, REG_SZ, _
           ByVal AutoDetectEncoding, Len(AutoDetectEncoding))
        lResult = RegSetValueEx(hKeyHandle, "Database", 0&, REG_SZ, _
           ByVal Database, Len(Database))
        lResult = RegSetValueEx(hKeyHandle, "Description", 0&, REG_SZ, _
           ByVal Description, Len(Description))
        lResult = RegSetValueEx(hKeyHandle, "Driver", 0&, REG_SZ, _
           ByVal Driver, Len(Driver))
        lResult = RegSetValueEx(hKeyHandle, "MultiByteEncoding", 0&, REG_SZ, _
           ByVal MultiByteEncoding, Len(MultiByteEncoding))
        lResult = RegSetValueEx(hKeyHandle, "Port", 0&, REG_SZ, _
           ByVal Port, Len(Port))
        lResult = RegSetValueEx(hKeyHandle, "QueryLog_On", 0&, REG_SZ, _
           ByVal QueryLog_On, Len(QueryLog_On))
        lResult = RegSetValueEx(hKeyHandle, "QueryLogFile", 0&, REG_SZ, _
           ByVal QueryLogFile, Len(QueryLogFile))
        lResult = RegSetValueEx(hKeyHandle, "QueryLogTime", 0&, REG_SZ, _
           ByVal QueryLogTime, Len(QueryLogTime))
        lResult = RegSetValueEx(hKeyHandle, "Server", 0&, REG_SZ, _
           ByVal Server, Len(Server))
      
        'Close the new DSN key.
      
        lResult = RegCloseKey(hKeyHandle)
      
        'Open ODBC Data Sources key to list the new DSN in the ODBC Manager.
        'Specify the new value.
        'Close the key.
      
        lResult = RegCreateKey(HKEY_CURRENT_USER, _
           "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources", hKeyHandle)
        lResult = RegSetValueEx(hKeyHandle, DataSourceName, 0&, REG_SZ, _
           ByVal Driver, Len(Driver))
        lResult = RegCloseKey(hKeyHandle)

    ElseIf UCase(DriverName) = UCase(FMP_DATADIRECT_DRIVER_NAME) Then

  
        'Setting for DataDirect SequeLink driver for FMP Server 8 and below
      
        DistinguishedName = ""
        Driver = FMP_DATADIRECT_DRIVER_DLL
        Host = SERVERNAME
        Port = FMP_ODBC_JDBC_PORT
        UseLDAP = "0"
      
        'Create the new DSN key.
      
        lResult = RegCreateKey(HKEY_CURRENT_USER, "SOFTWARE\ODBC\ODBC.INI\" & _
             DataSourceName, hKeyHandle)
           
        'Set the values of the new DSN key.
      
        lResult = RegSetValueEx(hKeyHandle, "Description", 0&, REG_SZ, _
           ByVal Description, Len(Description))
        lResult = RegSetValueEx(hKeyHandle, "DistinguishedName", 0&, REG_SZ, _
           ByVal DistinguishedName, Len(DistinguishedName))
        lResult = RegSetValueEx(hKeyHandle, "Driver", 0&, REG_SZ, _
           ByVal Driver, Len(Driver))
        lResult = RegSetValueEx(hKeyHandle, "Host", 0&, REG_SZ, _
           ByVal Host, Len(Host))
        lResult = RegSetValueEx(hKeyHandle, "Port", 0&, REG_SZ, _
           ByVal Port, Len(Port))
        lResult = RegSetValueEx(hKeyHandle, "ServerDataSource", 0&, REG_SZ, _
           ByVal ServerDataSource, Len(ServerDataSource))
        lResult = RegSetValueEx(hKeyHandle, "UseLDAP", 0&, REG_SZ, _
           ByVal UseLDAP, Len(UseLDAP))
      
        'Close the new DSN key.
      
        lResult = RegCloseKey(hKeyHandle)
      
        'Open ODBC Data Sources key to list the new DSN in the ODBC Manager.
        'Specify the new value.
        'Close the key.
      
        lResult = RegCreateKey(HKEY_CURRENT_USER, _
           "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources", hKeyHandle)
        lResult = RegSetValueEx(hKeyHandle, DataSourceName, 0&, REG_SZ, _
           ByVal DriverName, Len(DriverName))
        lResult = RegCloseKey(hKeyHandle)
    End If
End Sub


'To check if FMP ODBC DSN exist or not
Public Function DSNExists(DSN As String) As Boolean

 Dim hEnv As Long
 Dim sServer As String
 Dim sDriver As String
 Dim nSvrLen As Integer
 Dim nDvrLen As Integer

 If SQLAllocHandle(HANDLE_ENV, _
     Null_HANDLE, hEnv) <> 0 Then
  
     If SQLSetEnvAttr(hEnv, _
         ATTR_ODBC_VERSION, _
         OV_ODBC3, _
         IS_INTEGER) <> 0 Then
      
         sServer = Space$(DSN_LEN)
         sDriver = Space$(DESC_LENGTH)
      
         Do While SQLDataSources(hEnv, _
             GetNext, _
             sServer, _
             DSN_LEN, _
             nSvrLen, _
             sDriver, _
             DESC_LENGTH, _
             nDvrLen) = FoundOk
             If Trim(DSN) = Trim(Left$(sServer, nSvrLen)) Then
                DSNExists = True
                Exit Do
             End If
             sServer = Space$(DSN_LEN)
         Loop
     End If
     Call SQLFreeHandle(HANDLE_ENV, hEnv)
 End If


End Function


'To delete existing FMP ODBC DSN
Public Function Delete_User_DSN(DataSourceName As String) As Boolean
    Dim Result As Long

    Delete_User_DSN = False
  
    RegOpenKey HKEY_CURRENT_USER, DataSourceName, Result
    RegDeleteKey Result, DataSourceName
    RegCloseKey Result
  
    Delete_User_DSN = True
  
End Function


'Connection string needed for ADODB Connection object
Public Function ConnString(DSN_name As String, DriverName As String) As String
    Dim UID As String
    Dim PWD As String
  
    UID = "Specify user name"
    PWD = "Specify password"
  
    If UCase(DriverName) = UCase(FMP_ODBC_DRIVER_NAME) Then
        'For FileMaker ODBC driver for FMP Server 11
        ConnString = "Provider=MSDASQL.1;Password=" & PWD & ";Persist Security Info=True;User ID=" & UID & ";Data Source=" & DSN_name & ";"
      
    Else
        'For DataDirect SequeLink driver for FMP Server 8 and below
        ConnString = "DSN=" & DSN_name & "; UID=" & UID & "; PWD=" & PWD
      
    End If
End Function

Hope this article was helpful to fulfill your task in accessing FileMaker Pro data into Excel or any other Microsoft Office products using VBA code/script for dynamic ODBC DSN.

Share:

InformativeTechnicalContent.com