Question: Write a C + + program that opens a connection to the Chinook database chinook.db Download chinook.db . If the connection doesn't open successfully print
Write a C program that opens a connection to the Chinook database chinook.db Download chinook.db If the connection doesn't open successfully print an error message Error in connection: unable to open database file" from the database and end the program. Print a success message when it opens successfully. Then use sqliteexec and a callback function which may require more than one callback function to print the albums in the database. For each album, there should be a track listing. Each album will appear in the results only once. After running the query close the database to prevent corrupting it
Sample Output This is not a complete copy of the output:
Database opened successfully
AlbumId:
Album Name: For Those About To Rock We Salute You
Artist Name: ACDC
Tracks:
For Those About To Rock We Salute You
Put The Finger On You
Let's Get It Up
Inject The Venom
Snowballed
Evil Walks
COD
Breaking The Rules
Night Of The Long Knives
Spellbound
AlbumId:
Album Name: Balls to the Wall
Artist Name: Accept
Tracks:
Balls to the Wall
AlbumId:
Album Name: Restless and Wild
Artist Name: Accept
Tracks:
Fast As a Shark
Restless and Wild
Princess of the Dawn Starter Code: #include
#include
#include "sqliteh
int callbackvoid data int argc, char argv char azColName;
int main
open the database first
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
