After some time out of LC, I wanted to do some research into connecting to a SQLite database, but are confronted with problems.
Can someone tell me why I get an integer problem with the following script? The answer I get is " "tConID is not an integer: Problem creating or accessing database!"
on mouseUp
  global gConID
  local tConId
  
  put revOpenDatabase("sqlite","E:\Software\SQLite\SQLiteDBs","TestDB12.sqlite",,,,,,) into tConID
  
  if tConID is empty then 
     answer warning "tConID is empty: Problem creating or accessing database!"
     exit to top
  else 
     if tConID is not an integer then
        answer warning "tConID is not an integer: Problem creating or accessing database!"
        exit to top
     end if
  else
     answer information "Database is created! " & return & "The connection ID is: " & tConID 
     put tConID into gConID
  end if
end mouseUp
Thanks
Rob van der Sloot
			
			
									
									
						Connect to SQLite problem
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, asayd
- 
				Rob van der Sloot
 - Livecode Opensource Backer

 - Posts: 79
 - Joined: Sat Apr 17, 2010 9:21 am
 
- 
				FourthWorld
 - VIP Livecode Opensource Backer

 - Posts: 10065
 - Joined: Sat Apr 08, 2006 7:05 am
 - Contact:
 
Re: Connect to SQLite problem
Try using the complete file path in the third argument.
			
			
									
									Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
						LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Connect to SQLite problem
The example from the dictionary for sqlite is this: revOpenDatabase("sqlite",filepath,[sqliteOptions])
So, you'd want to instead do something like this..
put revOpenDatabase("sqlite","E:\Software\SQLite\SQLiteDBs\TestDB12.sqlite") into tConID
			
			
									
									
						So, you'd want to instead do something like this..
put revOpenDatabase("sqlite","E:\Software\SQLite\SQLiteDBs\TestDB12.sqlite") into tConID