Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8772213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:59:05+00:00 2026-06-13T17:59:05+00:00

Since I have to write a small library in Assembler that accesses a Sqlite3

  • 0

Since I have to write a small library in Assembler that accesses a Sqlite3 Database, I have started a search on how to use the sqlite3.dll. I have found a way to do that in fasm (I have to use masm32 for numerous reasons that do not contribute to solving the problem, it simply is a necessity) via cinvoke and referencing the library which is not available as it seems.
What I would basically like to know is whether it is possible for me to do a similar thing in masm or if I have to get the Addresses of every function I need to call individually via GetProcAddress.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:59:07+00:00Added an answer on June 13, 2026 at 5:59 pm

    Why wouldn’t it? It is simple, as simple as the following:

    .486
    .model flat, stdcall
    option casemap:none
    
    include \masm32\include\masm32.inc
    include \masm32\include\kernel32.inc
    include \masm32\include\user32.inc
    include sqlite3.inc
    
    .data
    szSQLDB         db  "MyDB.db3", 0
    szRandQuery     db  "SELECT * FROM Quit ORDER BY RANDOM() LIMIT 1;", 0
    
    .data?
    hDBase          dd  ?
    
    .code
    START:
        invoke  sqlite3_open, offset szSQLDB, offset hDBase
    
        call    GetQuitMsg
    
        invoke  sqlite3_close, hDBase
    
        invoke  ExitProcess, 0
    
    GetQuitMsg proc
    local   ppStmt
    
        invoke  sqlite3_prepare_v2, hDBase, offset szRandQuery, -1, addr ppStmt, 0
        invoke  sqlite3_step, ppStmt
        invoke  sqlite3_data_count, ppStmt
        .if eax !=0
            invoke  sqlite3_column_text, ppStmt, 0
            invoke  MessageBoxA, 0, eax, 0,0        
        .endif        
        ret
    GetQuitMsg endp
    end START
    

    I use a makefile, and Geany as my editor. The zip includes the test db, sqlite3.inc, but not the sqlite3.dll just unzip files, plop the sqlite3.dll into project directory and you will be good to go. I also do not use the MS link, instead I use GoLink as it does not need import libs, but if you have to use the MS Link, I have a SQLite import library around here somewhere.

    http://www.gunnerinc.com/files/SQLiteTest.zip

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm starting to write a small web application and have started thinking about securing
I am trying to write a small ruby script that will have two methods
Since I have started learning OpenGL, I thought I would as well write a
I have a Java library that uses a few things from the Android APIs.
I'm looking to write a small client-server-based text game that handles multiple client connections
I have a suite of small Java app that all compiles/packages to <name-of-the-app>.jar and
I have a small problem and since I am very new to all this
a conceptual question: I have a global system which sales agents use to write
I have written a small util in an app that syncs the time from
I wrote the following loop since I have to repeat the same/similar code 25

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.