Storing Database Data In VBA Code (Like a hardcoded password)

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
5,097
Office Version
  1. 2019
  2. 2007
Platform
  1. Windows
My mind has been wandering this cold, winter evening and came upon this idea.
Think in terms of a hardcoded password ...

How would one go about placing all of the data for a database in the VBA macro code (hardcoded) instead of listing it on a sheet
in columns and rows ?

And ... how would you go about searching that data that is hardcoded ?

Scenario: let's say the first record (if it were stored on a sheet) would occupy Col A1 : Z1 ... the second record A2 : Z2 ... and so on down the sheet.
However, these 'records' would be hardcoded into the VBA coding ... like a password.

What does that look like .. if it is possible ?
What are the limitations ?
How would you search a database configured like that ?

Is there a website anywhere that might discuss this in detail ?

Thanks for reading.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I put my name in a spreadsheet by using different variables and chars etc around the book, then assembling the values as parts of strings then pushing the whole thing into a cell with light grey text, but it would be laborious to unpick , but reasonably easy from the point where it is visible on the sheet. To change that password would be a pain.

We had some malicious code pasted onsite which was isolated

MsgBox acadure("n3gj,T`s,`Tg""ff`wwbgK~s,g3))g"",7g)js`-""**g3sg"",Tj4(js~wgw3)T-""s`g"",FgTs7g""/""j,b"), vbCritical, acadure("#ss3s")

of which this is one line out of 100, you can partly guess the steps involved in building the hidden message
 
Last edited:
Upvote 0
.
I believe this line
Think in terms of a hardcoded password ..
has confused things.

Forget anything I wrote concerning "password". that is not the subject at hand.


If I wanted to paste records, directly into macro code - hardcoded - in the VBE - instead of writing the data to cells in a worksheet .... how does one do that ?
The data will never change .. never be edit ... only searched and displayed in Textboxes on a Userform.

Is it possible ?

What are the restrictions ?

How do you accomplish it / what does the code look like ?

Is there a website / reference that speaks to the method ?


Thank you.
 
Upvote 0

Forum statistics

Threads
1,224,764
Messages
6,180,841
Members
453,001
Latest member
coulombevin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top