By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 985 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Access VBA to Connect Http Request Like Python Used

P: 1
I have a Python Code As given below that I wish to use Access VBA to do the same thing.

Here is the Python Code example:

import datetime
import pytz
import hmac
import hashlib
import base64

username = "username"
password = "password"
access_token = "access_token"
secret_key = "secret_key"
date=datetime.datetime.now(tz=pytz.utc).astimezone (pytz.timezone('US/Pacific')).strftime('%m%d%Y')
print(date);
string_to_sign = username + password + access_token + date
print(string_to_sign);
print(secret_key);
print(hashlib.sha1)
encoded = string_to_sign.encode('UTF-8')
print(encoded)
digest = hmac.new(secret_key.encode(), encoded,hashlib.sha1).digest()
digest=base64.b64encode(digest)
headers=dict(Authorization='NNN {}:{}'.format(access_token, digest))
print(headers)


I need help to determine the functions that I have no concept of it in VBA. For example, hashlib.sha1 ? What can I use with VBA here???

What can I use with VBA for string_to sign.enccode('UTF-8')??

What can I use for the hmac.new function???

What can I use for the base64.b64encode() function???

What can I use for the dict() function????

If there isn't a VBA version of the function, a description could help me develope a version for VBA.

I am using Office 2013 VBA from Access, etc.

I would appreciate any help you can offer!!!!

Thank You,
May 22 '18 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.